I can see that this might have "long fingers" in your app. Bummer.

Anyhow, you might be able to also avoid clearing depth in your other
cameras. Here's something to try: In the camera that renders the skydome,
use Depth in the StateSet to set the depth range to something like
0.999-1.0. This puts your skydome all the way in the back of the depth
buffer, and then it should be far enough back that subsequent scene cameras
shouldn't need to clear either the color or depth buffers.

It might be kind of a pain in your app, but hopefully avoiding those clears
buys you some small performance gain that makes the change as a whole
beneficial.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
Jean-Sébastien Guay
Sent: Tuesday, April 21, 2009 2:29 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Geometryconsidered in near+far plane auto
computation

Hi Chris,

>   From memory, can't you create a NodeCallback that checks to see if 
> it's being traversed by a CullVisitor (dynamic-cast the NodeVisitor) 
> and if so, temporarily switch off the near/far computation, traverse the
node/subgraph, and then turn it back on?

That's what I've done (see a previous post in this thread) but it didn't
work for some reason - the subgraph was never rendered.

I've done what Paul suggested: the skydome is under a PRE_RENDER camera and
so has its own projection matrix and thus, doesn't affect the computed
near/far values for the main camera. It works, but it has more implications
on the rest of my scene graph/viewer setup than I'd like. 
All other cameras need to be set to only clear the depth buffer otherwise
they'll clear my skydome (of course) and since in my app, views may be added
at any time, this introduces an extra required step when creating a view...

I think I'd prefer being able to disable the auto compute near/far for the
node itself, and be done with it. If you can tell me why my code posted
before doesn't render anything, I'm all ears.

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/
_______________________________________________
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

Reply via email to