Hello all, I am new to OSG and I am having trouble implementing something in my scenegraph. Because my graph is a little complicated I will give you a simpler version of it focusing on the main concept. I have a scene with a model. This model consists of 3 submeshes. For each submesh I do three passes. These passes are the exact same for all submeshes. Here is the desired rendering order: FirstMesh-pass1, FirstMesh-pass2, FirstMesh-pass3, SecondMesh-pass1, SecondMesh-pass2, ... etc Any other rendering order won't work. (this is how the algorithm works)
Because the statesets and a lot of other nodes are the same I want to share them between my passes. Because of this, at the start of my graph I place 3 osg::Cameras with different culling masks. And then I set different node mask to each of my submeshes. So, each camera will draw a different submesh. What I get is a very strange effect. Looks like it is something wrong with the depth buffer. (keep in mind that depth test is enabled and depth writes are on). Looks like having multiple cameras drawing at the same viewport somehow does not work. Do I miss something? Most likely I just misuse the osg::Cameras or I don't really understand their concept. Looking the diagram and the code it is easy to figure out what exactly I want to do. Do you have any suggestion around this problem? Thanks a lot for your time. Cheers, George PS: In the source code Imagine that the osg::Group named 'secondaryRoot' is a "black box" containing my 3 passes/renderbins ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34699#34699 Attachments: http://forum.openscenegraph.org//files/main_146.cpp http://forum.openscenegraph.org//files/diagram_985.png _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org