I'm trying to add multisampling capabilities to my floating-point FBOs, but I've found what I think is a bug in osgUtil/RenderStage.cpp. Basically, when I specify a number of samples greater than 0, I actually get a non-floating-point framebuffer.
See line 380 in RenderStage.cpp:

GLenum internalFormat = attachment._internalFormat;

if the attachment is actually a RTT target rather than a rendertarget, the internalFormat field will always be zero. This will make RenderStage pick the default value which is GL_RGBA, thus ignoring the target texture's internal format (GL_RGBA16F_ARB in my application). Replacing the above code with the following, fixes the problem for me:

GLenum internalFormat;
if (attachment._texture.valid())
   internalFormat = attachment._texture->getInternalFormat();
else
   internalFormat = attachment._internalFormat;

Now, I'm pretty new to all this multisampling stuff, and I'm not sure whether this fix is reliable and/or correct, so I'm not filing a submission for now. Robert, I can send the modified file if you think it's appropriate.

Cheers,
Marco

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

Reply via email to