Changeset 147 for osgVisual/src


Ignore:
Timestamp:
Nov 7, 2010, 6:23:54 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/src/distortion/visual_distortion.cpp

    r145 r147  
    6363    arguments.getApplicationUsage()->addCommandLineOption("--hdr","Render distortion as HDR.");
    6464
    65         arguments.getApplicationUsage()->addKeyboardMouseBinding("d", "Toggle Distortion.");
    66 
    6765        // 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)) {}
    7167    while (arguments.read("--height", tex_height)) {}
    7268
    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; }
    7670    while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
    7771    while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; }
     
    7973    while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
    8074
    81     useTextureRectangle = false;
    8275    while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; }
    83         useShaderDistortion = false;
     76
    8477    while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; }
    85     useHDR = false;
     78
    8679    while (arguments.read("--hdr")) { useHDR = true; }
    8780
    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)) { }
    9182    while (arguments.read("--blendmap", blendMapFileName)) { }
    9283
     
    127118        OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion initialize..." << std::endl;
    128119
     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
    129133        // Process Commandline arguments:
    130134        processCommandlineparameters();
     
    134138
    135139        // add the keyboard handler for toggle distortion
     140        arguments.getApplicationUsage()->addKeyboardMouseBinding("d", "Toggle Distortion.");
    136141        kBEventHandler = new ToggleDistortionKBEventHandler( this );
    137142        viewer->addEventHandler( kBEventHandler );
     
    379384            osg::Shader* distortFragObj = new osg::Shader( osg::Shader::FRAGMENT );
    380385
    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" ) &&
    383388                distortMapTexture)
    384389            {
Note: See TracChangeset for help on using the changeset viewer.