Changeset 147 for osgVisual


Ignore:
Timestamp:
Nov 7, 2010, 6:23:54 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/bin/osgVisualConfig.xml

    r129 r147  
    22<osgvisualconfiguration>
    33  <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>
    518  </module>
    619  <module name="sky_silverlining" enabled="yes"></module>
  • 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.