Show
Ignore:
Timestamp:
12/17/08 18:23:17 (5 years ago)
Author:
robert
Message:

From J.P Delport, "I changed the default HDR mode to the ARB format and put in comments for some other possible modes.

Some other comment cleanups too."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmultiplerendertargets/osgmultiplerendertargets.cpp

    r8883 r9386  
    3737 
    3838// 
    39 // Below is relatively straight forward example of use OpenGL multiple render targets extension 
     39// Below is relatively straight forward example of using the OpenGL multiple render targets (MRT) extension 
    4040// to FrameBufferObjects/GLSL shaders. 
    4141// 
     
    214214        if (useHDR) 
    215215        { 
    216             textureRect[i]->setInternalFormat(GL_FLOAT_RGBA32_NV); 
    217             //textureRect[i]->setInternalFormat(GL_FLOAT_RGBA16_NV); 
     216            // Default HDR format 
     217            textureRect[i]->setInternalFormat(GL_RGBA32F_ARB); 
     218 
     219            // GL_FLOAT_RGBA32_NV might be supported on pre 8-series GPUs 
     220            //textureRect[i]->setInternalFormat(GL_FLOAT_RGBA32_NV); 
     221 
     222            // GL_RGBA16F_ARB can be used with this example,  
     223            // but modify e-12 and e12 in the shaders accordingly 
     224            //textureRect[i]->setInternalFormat(GL_RGBA16F_ARB); 
     225             
    218226            textureRect[i]->setSourceFormat(GL_RGBA); 
    219227            textureRect[i]->setSourceType(GL_FLOAT); 
     
    380388 
    381389    // set up the usage document, in case we need to print out how to use this program. 
    382     arguments.getApplicationUsage()->setDescription(arguments.getApplicationName() + " demonstrates the use of multiple render targets (MRT) using frame buffer objects. A render to texture camera is used to render to four textures using a single shader. The four textures are then combined to texture the viewed geometry."); 
     390    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName() + " demonstrates the use of multiple render targets (MRT) with frame buffer objects (FBOs). A render to texture (RTT) camera is used to render to four textures using a single shader. The four textures are then combined to texture the viewed geometry."); 
    383391    arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] ..."); 
    384392    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information."); 
    385393    arguments.getApplicationUsage()->addCommandLineOption("--width","Set the width of the render to texture."); 
    386394    arguments.getApplicationUsage()->addCommandLineOption("--height","Set the height of the render to texture."); 
    387     arguments.getApplicationUsage()->addCommandLineOption("--image","Render one of the targets to an image, then apply a post draw callback to modify it, and use this image to update a texture."); 
    388     arguments.getApplicationUsage()->addCommandLineOption("--hdr","Use high dynamic range. Create floating point textures to render to."); 
     395    arguments.getApplicationUsage()->addCommandLineOption("--image","Render one of the targets to an image, then apply a post draw callback to modify it and use this image to update the final texture. Print some texture values when using HDR."); 
     396    arguments.getApplicationUsage()->addCommandLineOption("--hdr","Use high dynamic range (HDR). Create floating point textures to render to."); 
    389397 
    390398    // construct the viewer.