Robert, My RTT camera has a postdraw callback. When I call glDepthMask( GL_TRUE ) in the RTT camera's postdraw callback, the flickering stops. The whole reason this happens is that osg::StateAttributes only have an apply() method. They must not restore() the previous state. Don't you think the StateAttribute should be limited, at least to the subtree rooted at that node? osg::Depth gets applied, disables writing to the depth buffer, but glDepthMask( GL_TRUE ) never gets called before the camera/renderstage does a clear(), so the depth buffer doesn't get cleared, despite the fact that it's in the camera's clear mask. That being said, how does one utilize osg::Depth on only PART of a scene? Do I have to guess which is the next sibling node in the cull/draw traversal and add another osg::Depth to it? Is there a place that I can put another osg::Depth that will set the depth mask to true BEFORE the camera/renderstage does a clear()? I tried the camera, but I might have hit the wrong one. John ________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Argentieri, John-P63223 Sent: Wednesday, June 11, 2008 3:17 PM To: [EMAIL PROTECTED] Subject: [osg-users] RTT, ParticleSystem, Depth Robert, I have an RTT setup, with particle systems. When I put the particle system behind a geometry which is transparent, the particles are not drawn behind the geometry. The geometry in question has setRenderingHint( TRANSPARENT_BIN ) set. The particle system draw() function sets glDepthMask( GL_FALSE ); When I create an osg::Depth that disables glDepthMask and assign it to the transparent geometry, the particles can be seen through the geometry! Wonderful. The problem is, when RTT is enabled, the whole scene flickers when VIEW_FRUSTUM_CULLING does not remove the osg::Depth from the scene. If RTT is disabled in the app it works fine. Any ideas? Thanks for your time and consideration! John Argentieri
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org