clearflags.Zbuffer

ThePentiumGuy

Senior Contributor
Joined
May 21, 2003
Messages
1,113
Location
Boston, Massachusetts
hey,
i created a mesh program thingy,
the only way i got it to work was if i changed:

D3Ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.FromArgb(0, 20, 0), 0, 0)
to
D3Ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.FromArgb(0, 20, 0), 1, 0)

that argument(Changing from 0 to 1) is the ZDepth,
does anyone know what this argument does? Becuase if it was 0, the mesh wouldnt be displayed at all
 
That is the value you initialize z-buffer with. It ranges typically from 0 (front) to 1 (back). It is used internally to determine if the new stuff should be rendered. It is rendered only if its depth is closed to camera than z-values already in the z-buffer. So when you set it to 0 you effectively said that there is a plane right in front of the camera meaning that nothing behind it could be seen.
 
Back
Top