From Riccardo Corsi, "please find attached a small patch for HDR plugin,

which simply set by default the internal pixel format to GL_RGB32F_ARB where appropriate.

In the current version there's a comment saying that the plugin set it to GL_RGB8 (even when reading from float) to support old graphics cards,
but the comment dates back to 2004...
What's more I believe that it's correct to expect a floating texture format if you're loading an hdr image.
It was quite troublesome for us to discover why our background image wasn't showing hdr data...

In case you accept the submission, I've removed the comment as it would be misleading to leave it there."
This commit is contained in:
Robert Osfield 2012-02-20 12:12:43 +00:00
parent 48b9b25805
commit 2a97715239

View File

@ -168,12 +168,7 @@ public:
internalFormat = GL_RGBA8;
pixelFormat = GL_RGBA;
} else {
// In a perfect world it should be GL_RGB32F_ARB,
// but by default it works fine as GL_RGB8. You
// can set it as GL_RGB32F_ARB in the method
// setInternalFormat of osg::Texture{xD, Rectangle
// and CubeMap} if your GPU support it.
internalFormat = GL_RGB8;
internalFormat = GL_RGB32F_ARB;
pixelFormat = GL_RGB;
}