Changeset 147 for osgVisual/src
- Timestamp:
- Nov 7, 2010, 6:23:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.