Re: [osg-users] render a node last
Hi Lucie, you can add the node you want to draw last under new camera,and set the render order to big number (see Camera::setRenderOrder). You would then need to sync the new camera matrices with the main camera (probably via update callback). This is how I did it and it works -Nick On Fri, Oct 8, 2010 at 7:36 PM, Paul Martz pma...@skew-matrix.com wrote: It looks like you need to turn on backface culling for the sphere. But if you're going to draw non-convex objects, then turning off depth testing won't work, and instead you'll need to leave it enabled and clear the depth buffer before you draw the objects that must always be in front. For this you'll want to look at using nested Camera nodes. Take a look at osghud. -Paul On 10/8/2010 6:36 AM, lucie lemonnier wrote: Hi, I put this line of code for render my model last : mModel = osgDB::readNodeFile(mFileToLoad); osg::StateSet* state = mModel-getOrCreateStateSet(); state-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); state-setRenderBinDetails(20,Render_Bin); But I get a odd render (see attachment). I am trying to put the sphere over the plane. Did I miss something in my code? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32559#32559 Attachments: http://forum.openscenegraph.org//files/render_172.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render a node last
Hi, I put this line of code for render my model last : mModel = osgDB::readNodeFile(mFileToLoad); osg::StateSet* state = mModel-getOrCreateStateSet(); state-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); state-setRenderBinDetails(20,Render_Bin); But I get a odd render (see attachment). I am trying to put the sphere over the plane. Did I miss something in my code? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32559#32559 Attachments: http://forum.openscenegraph.org//files/render_172.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render a node last
It looks like you need to turn on backface culling for the sphere. But if you're going to draw non-convex objects, then turning off depth testing won't work, and instead you'll need to leave it enabled and clear the depth buffer before you draw the objects that must always be in front. For this you'll want to look at using nested Camera nodes. Take a look at osghud. -Paul On 10/8/2010 6:36 AM, lucie lemonnier wrote: Hi, I put this line of code for render my model last : mModel = osgDB::readNodeFile(mFileToLoad); osg::StateSet* state = mModel-getOrCreateStateSet(); state-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); state-setRenderBinDetails(20,Render_Bin); But I get a odd render (see attachment). I am trying to put the sphere over the plane. Did I miss something in my code? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32559#32559 Attachments: http://forum.openscenegraph.org//files/render_172.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] render a node last
Hi, How to render a node in my scene always last? I want this object is over the other objects in my scene. Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32531#32531 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render a node last
You can use a Camera post draw callback (setPostDrawCallback) or you can use render bins (setRenderBinDetails). Search the newsgroup or OSG source for more info. You might also need to deal with the depth buffer. -Paul On 10/7/2010 10:22 AM, lucie lemonnier wrote: Hi, How to render a node in my scene always last? I want this object is over the other objects in my scene. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org