Page 1 of 1

Z-Buffer Clear on Renderpass?

Posted: Sun Feb 14, 2010 12:15 am
by diki
hi,
i noticed that the zbuffer is not cleared after a renderpass, independent of the used ClearScreenMode. could we have a setting for that?

i'm trying to render a scene with large differences in size (far away planets and close small things on the surface of one planet), and i tried to achieve this with two renderpasses (a first pass with large values for the near & far clipping plane, a second pass with smaller values). sometimes the large objects intersect the small ones even though they are rendered in different passes.

Posted: Sun Feb 14, 2010 11:42 am
by Kjell
Hi diki,

Would be nice to have a separate flag for clearing the Z-Buffer yes. There are however a number of solutions for what you're trying to do already.

- Rely on "DepthSorted" entirely and disable the Z-Buffer for the Materials in your first pass.
- Render the first pass to a RenderTarget and use this as background in your second pass.
- Push the z-depth value of objects in the first pass back using a shader.

K

Posted: Sun Feb 14, 2010 5:20 pm
by diki
hi kjell, those tips are helpful - as always! :)