[osg-users] Is it possible to clear just certain textures in a framebuffer with multi target rendering?

Amudhan Subashgobi tm.subashgobi at gmail.com
Mon Sep 11 12:48:10 PDT 2017


Hi,
Is it possible to clear just certain textures in a framebuffer with multi target rendering?

i am searching for equivalent functionality for glClearBufferfv. 

Any help would be greatly appreciated.

example shader code:

out vec4 fragcolor1; // first target
out vec4 fragcolor2; // second target
void main()
{
      fragcolor1 = vec4(1.0,0.0,0.0,1.0);
      fragcolor2.g = 1.0;
}
 basically i want to initialize first target as osg::Vec4(0.0,0.0,0.0,0.0);
and i want to initialize my second target to osg::Vec4(1.0,0.0,0.0,0.0).

I tried calling setClearColor in osg::Camera, but this initializes both targets to same value.

Thanks & Regards,
amudhan

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







More information about the osg-users mailing list