I've been trying to get a HDR skybox in my scene and ran across the
following:

 

-       With the option "RGB8"  ( osgDB::ReaderWriter::Options( "RGB8" )
)

o      The image is converted to LDR before being stored in a texture.

 Doesn't that defy the whole point of being HDR to begin with?

 

-       With the option "RAW"  ( osgDB::ReaderWriter::Options( "RAW" )
)

o      The image is stored in a texture without with minimal processing.

*       rawRGBEData divides each component by 255

 

 

The problem is that my rendering results are different.

 

RGB8: http://img162.imageshack.us/img162/8467/hdrrgb8rn7.jpg

RAW: http://img206.imageshack.us/img206/8574/hdrrawza9.jpg

 

I understand that with "raw" images, the conversion must be done in the
shader.  Here is my shader:

 

uniform sampler2D diffuseTexture;

 

vec4 textureRGBE( sampler2D sampler, vec2 coords )

 {

      ivec4 rgbe = texture2D( sampler, coords ) * 255. + 0.5;

      float e = rgbe.a - ( 128.0 + 8.0 );

      return vec4( rgbe.rgb * exp2( e ), 1.0 );

 } 

 

void main(void)

{                         

// Sample the texture

             vec4 diffuse = textureRGBE ( diffuseTexture,
gl_TexCoord[0].xy );                        

             vec4 toneMappedColor = vec4( pow( diffuse.rgb, 0.55 ), 1.0
);

                          

              gl_FragColor = toneMappedColor;

}

 

I would really like to make use of dynamic exposure effects but it seems
like I need to maintain HDR values until the moment the color is tone
mapped.  At least in order to get good results.

 

Please advise,

Michael Guerrero ( Delta3D )

 

 

 

 

 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to