Hello again,
In my project I need to setup a second render pass that performs the
following:
Render the scene from the original camera's view (as in the first RTT pass).
Set the second camera to be pre-render with render-order increased.
Render some volumes and apply a shader a those positions.
With this I have some questions:
1. If the second camera is set up with
setReferenceFrame(osg::Transform::RELATIVE_RF), will this be the exact
view as in the first camera?
2. Can I reuse the depth buffer produced in the first rendering pass for
depth-testing in the second pass via simply attaching it as depth-target
and not writing to it?
3. My goal is to execute the shaders only at the positions in the view
space where the volumes intersect some geometry, in order to calculate
view-space lighting there.
Unfortunally I get totally wrong view space coordinates with this (e.g.
the light position calculated by gl_ModelViewMatrix * vec4(0,0,0,1) is
somehow screwed)
Is this the way to go?
I have done 1) and 3) in plain OpenGL, but somehow I'm totally stuck
with light-vector calculation in the second pass. And I somehow think
that my camera setup is just wrong.
So how do I setup a pass, where I draw from the exact view of the first
RTT pass?
cheers
Sebastian
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org