Greetings,

I have a multisampled texture that I've rendered my scene into, and I'd like to 
attach it to the StateSet of a full-screen quad so I can do some explicit 
multisampling. Here is the call I am making:


Code:

fsq->getOrCreateStateSet()->setTextureAttributeAndModes(0, inputTexture, 
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);




Where inputTexture is an osg::Texture2DMultisample.

Since osg::Texture2DMultisample derives from osg::Texture, it correctly 
identifies itself as a texture attribute through isTextureAttribute(). However, 
eventually, StateSet::setTextureMode is called, and this call fails because 
GL_TEXTURE_2D_MULTISAMPLE is not listed as a possible texture mode in the 
TextureGLModeSet class (see the top of StateSet.cpp).

Should this list be updated to include GL_TEXTURE_2D_MULTISAMPLE or am I doing 
something wrong? Note: I am using OSG 3.0, but I've checked 3.3 and it is the 
same.

Some background info on why I'm doing this: I'm trying to do explicit 
multisampling, which allows me to customize how the samples are blended. I 
already have it working in vanilla OpenGL. Basically the steps are a) render 
your scene into a multisampled FBO, b) bind the multisampled FBO and render a 
full-screen quad using a special shader, c) inside that shader, grab the 
individual samples using texelFetch and then blend them using your own custom 
blending, d) output the result. It is useful when you need to process the 
samples in some way before they are blended (e.g., tone map them).

If you can think of a better way to do explicit multisampling with OSG, I would 
be much obliged if you would point me in the right direction. 

Thank you!

Cheers,
Frank[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57959#57959





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

Reply via email to