Cedric Pinson wrote:
I am doing a deferred shading and i have a problem to use the depth
buffer as i would like. Here the order of drawing:
consider using a scene A

1 Draw only in the zbuffer
2 setup a camera with mtr and draw normal and color into two render
target. Dont touch to the depth buffer
- for this step i enable the zbuffer in read only and i dont attach a
depth buffer to the camera, i want the z to be tested from the viewport
done on pass 1. It's like the zbuffer is lost between 1 and 2

You said you DON'T attach the depth buffer to the camera in step 2? I believe you need to attach it for the z test. Leave the depth test enabled with the same depth function, but set the depth write mask to false. Then it will test against the depth buffer.

--
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to