Hi, I have to recommend that you browse the archives on this topic, there has been a huge amount said on this topic.
Robert. On 8/22/07, blinkeye <[EMAIL PROTECTED]> wrote: > Hi Robert, > > thanks a lot for the prompt answer. I've been eagerly following the other > thread you mentioned, thanks. > > I'm looking at the src/osg/ShapeDrawable.cpp now, it sounds like I have to > do the same thing. > > I nevertheless attached a few screenshots to make it clear. The last two > images (inside1.jpg and inside2.jpg) show that the inside faces are not > drawn when the camera moves into the triangle. > > On Wed, August 22, 2007 15:12, Robert Osfield wrote: > > I'm not 100% sure what you are after, my best guess is that you want > > to renderer a transparent object that is a has front and back faces > > w.r.t the viewer, but depending on the view the front face sometimes > > occludes the back face preventing transparency from working correctly. > > > > I answered a question on transparent sorting yesterday so look this > > up. An extra trick you can apply for single geometries like > > spheres/cubes is enforce the required draw order for transparent > > objects (you must first draw the furthest faces and then the nearest), > > is to use cull face to cull back faces, and then use two sets of > > primitives within this geometry, the first set have their orientations > > pointing inwards, then the second have them pointing outwards. The > > src/osg/ShapeDrawable.cpp uses this trick. > > > > Robert. > > > > On 8/22/07, blinkeye <[EMAIL PROTECTED]> wrote: > >> Hello fellow osg users > >> > >> I've been trying for days to implement what I thought of as a simple > >> thing: > >> > >> A translucent figure like a dome, a cubus or a triangle where faces > >> behind > >> don't shine through and which inside faces are rendered when the camera > >> is > >> inside the figure. > >> > >> I've managed that by using GL_CULL_FACE > >> > >> osg::StateSet* states = new osg::StateSet(); > >> states->setRenderingHint( osg::StateSet::TRANSPARENT_BIN ); > >> states->setRenderBinDetails( 2, "RenderBin" ); > >> states->setMode( GL_CULL_FACE, osg::StateAttribute::OVERRIDE | > >> osg::StateAttribute::ON ); > >> states->setMode( GL_BLEND, osg::StateAttribute::OVERRIDE | > >> osg::StateAttribute::ON ); > >> states->setMode( GL_DEPTH_TEST, osg::StateAttribute::OVERRIDE | > >> osg::StateAttribute::ON ); > >> > >> So far so good, but now the problem: If the camera is inside the > >> translucent figure I don't see the inside faces. > >> > >> Is there something I'm doing wrong or shouldn't now the inside faces be > >> drawn (but not the outside faces)? > >> > >> I know this is more an OpenGL issue but I can't seem to find the answer > >> anywhere. > >> > >> > >> > >> > >> > >> _______________________________________________ > >> osg-users mailing list > >> [email protected] > >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >> > > _______________________________________________ > > osg-users mailing list > > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

