Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-15 Thread Robert Osfield
Hi Chris, On Fri, May 15, 2009 at 2:10 AM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote:  I will expand on the abstract explanation, and then reveal my optimal solution -- which is a bit of a hack, but is still the most elegant.  Basically we have VPB terrain for a very large area, but

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Robert Osfield
Hi Chris, On Thu, May 14, 2009 at 1:01 AM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: The Goal: Render both of them, but with object A _always_ obscured by object B, regardless of what their Z values (which are mostly coincident) would normally dictate. This type of task is exactly what

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Chris 'Xenon' Hanson
Robert Osfield wrote: This type of task is exactly what the stencil buffer is good for. The OSG supports stencil buffer natively. See the osgreflect example. I thought of that too, but it seemed like overkill since all I needed was a bulk Z clear at the right time. Plus, I couldn't

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Jean-Sébastien Guay
Hi Chris, Paul suggested using multiple Camera objects in the Scene and playing with the heirarchy, reference frame and identity matrix to make a sub-camera track its parent. That's probably what I would have tried too. It seems weird to me that the ClearNode clears at the start of rendering

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Robert Osfield
On Thu, May 14, 2009 at 1:32 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: Robert Osfield wrote: This type of task is exactly what the stencil buffer is good for.  The OSG supports stencil buffer natively.  See the osgreflect example.  I thought of that too, but it seemed like overkill

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Paul Martz
I Robert -- No, I don't think stencil applies here. Chris might not have described the rendering task precisely. What he is trying to do is a sort of smart depth partition, in which he knows that part of his scene graph is always the background, and another part of always the foreground. So if he

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Chris 'Xenon' Hanson
Paul Martz wrote: I Robert -- No, I don't think stencil applies here. Chris might not have described the rendering task precisely. What he is trying to do is a sort of smart depth partition, in which he knows that part of his scene graph is always the background, and another part of always the

Re: [osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-14 Thread Jean-Sébastien Guay
Hi Chris, I will expand on the abstract explanation, and then reveal my optimal solution -- which is a bit of a hack, but is still the most elegant. [...] Wow, yeah that's a nice setup and good solution to it. I'll probably be able to use a similar technique in our simulators. Thanks for