- Timestamp:
- Nov 7, 2010, 6:23:54 PM (14 years ago)
- Location:
- osgVisual
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/bin/osgVisualConfig.xml
r129 r147 2 2 <osgvisualconfiguration> 3 3 <module name="distortion" enabled="yes"> 4 <distortion channelname="center"></distortion> 4 <!-- XML configuration of the module "distortion" 5 channelname = name of he channel, used to load the distortion- and blendmaps 6 renderimplementation = technique to distort. 7 Available options: 8 fbo : renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT 9 pbuffer : renderImplementation = osg::Camera::PIXEL_BUFFER 10 pbuffer-rtt : renderImplementation = osg::Camera::PIXEL_BUFFER_RTT 11 fb : renderImplementation = osg::Camera::FRAME_BUFFER 12 window : renderImplementation = osg::Camera::SEPERATE_WINDOW 13 --> 14 <distortion channelname="center" renderimplemmentation="fbo" hdr="yes"> 15 <!-- optional: <distortionmap filename="distmap.png"></distortionmap> --> 16 <!-- optional: <blendmap filename="blendmap.png"></blendmap> --> 17 </distortion> 5 18 </module> 6 19 <module name="sky_silverlining" enabled="yes"></module> -
osgVisual/src/distortion/visual_distortion.cpp
r145 r147 63 63 arguments.getApplicationUsage()->addCommandLineOption("--hdr","Render distortion as HDR."); 64 64 65 arguments.getApplicationUsage()->addKeyboardMouseBinding("d", "Toggle Distortion.");66 67 65 // Read out Distortion CMDLine arguments 68 tex_width = 2048; 69 tex_height = 2048; 70 while (arguments.read("--width", tex_width)) {} 66 while (arguments.read("--width", tex_width)) {} 71 67 while (arguments.read("--height", tex_height)) {} 72 68 73 renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; 74 75 while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } 69 while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } 76 70 while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } 77 71 while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; } … … 79 73 while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } 80 74 81 useTextureRectangle = false;82 75 while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; } 83 useShaderDistortion = false; 76 84 77 while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; } 85 useHDR = false; 78 86 79 while (arguments.read("--hdr")) { useHDR = true; } 87 80 88 distortMapFileName = "..\\resources\\distortion\\distort_distDisabled.bmp"; 89 while (arguments.read("--distortionmap", distortMapFileName)) { } 90 blendMapFileName = "..\\resources\\distortion\\blend_distDisabled.bmp"; 81 while (arguments.read("--distortionmap", distortMapFileName)) { } 91 82 while (arguments.read("--blendmap", blendMapFileName)) { } 92 83 … … 127 118 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion initialize..." << std::endl; 128 119 120 // Initialize variables: 121 tex_width = 2048; 122 tex_height = 2048; 123 renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; 124 useTextureRectangle = false; 125 useShaderDistortion = false; 126 useHDR = false; 127 distortMapFileName = "..\\resources\\distortion\\distort_distDisabled.bmp"; 128 blendMapFileName = "..\\resources\\distortion\\blend_distDisabled.bmp"; 129 130 131 132 129 133 // Process Commandline arguments: 130 134 processCommandlineparameters(); … … 134 138 135 139 // add the keyboard handler for toggle distortion 140 arguments.getApplicationUsage()->addKeyboardMouseBinding("d", "Toggle Distortion."); 136 141 kBEventHandler = new ToggleDistortionKBEventHandler( this ); 137 142 viewer->addEventHandler( kBEventHandler ); … … 379 384 osg::Shader* distortFragObj = new osg::Shader( osg::Shader::FRAGMENT ); 380 385 381 if (loadShaderSource( distortVertObj, " shader.vert" ) &&382 loadShaderSource( distortFragObj, " shader.frag" ) &&386 if (loadShaderSource( distortVertObj, "../resources/distortion/shader.vert" ) && 387 loadShaderSource( distortFragObj, "../resources/distortion/shader.frag" ) && 383 388 distortMapTexture) 384 389 {
Note: See TracChangeset
for help on using the changeset viewer.