[email protected] wrote: > Hi, > > I want to render a scene two times filling the depth-buffer during the > first render-pass and using the depth-buffer then to render the second > pass (with another geometry). > I added an OSG::DepthChunk to both geometries (the same Chunk for both) > and I also added an OSG::RenderBuffer (as depth buffer with internal > format GL_DEPTH_COMPONENT24) to my OSG::FrameBufferObject. > > I disable my second geometry using OSG::Node->setTravMask(0), then I > render the first time with OSG::Window->render(ra). > At this point I want the depth-buffer to be filled. > I enable the second geometry now and disable the first geometry. Then I > render again with OSG::Window->render(ra). > > What I get is the image resulting from rendering the second geometry (as > expected) but without respect to the filled depth-buffer. Depth buffer > seems to work because when I set it to GL_GREATER nothing is rendered at > all. > > So my question is: How can I keep the depth-buffer when I render the next > image?
Use a PassiveBackground on the ViewPort, it leaves the framebuffer alone when rendering the scene. Cheers /Marcu ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
