Z-Buffer Clear on Renderpass?

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Z-Buffer Clear on Renderpass?

Post 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.
Attachments
multiz v01.zgeproj
move mouse up & down to translate the big planet over the z-axis
(2.03 KiB) Downloaded 542 times
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki »

hi kjell, those tips are helpful - as always! :)
Post Reply