Skip to main content
GameDev.net gamedev.net
🔒 Locked

Z Buffer enabled but does not work...

Started by CommanderXXL Oct 9, 2001 at 1:19 PM 3 replies 150+ views
Original Post
CommanderXXL
CommanderXXL
I have enabled my ZBuffer using the standard AutoDepthStencil flags of the present parameters. I tried using 16 Bit and 32 Bit buffers i even tried D24S8. But if i draw two simple triangles one at 1.0f and one at -1.0f a see both at the same time and it flickers like there is now ZBuffer. And Yes i Clear the Buffer each Frame to 1.0f and the Compare function is set to LESSEQUAL. Please tell me where is my problem. By CommanderXXL
---------------------------- By CommanderXXLCommander@bloomm.de----------------------------
DeltaVee
DeltaVee
What are your min/max values for your Z-buffer.

The Z buffer is not linear, it uses an approximation for depth, so if the range between min and max is very large, objects that are very close together appear to be the same distance away.

Try reducing the min/max range.



D.V.
D.V.Carpe Die<FONT C
CommanderXXL
CommanderXXL
How can i change these Values?
Is it the the near/far clipping plane in my call to
createprojection matrix?

By CommanderXXL
---------------------------- By CommanderXXLCommander@bloomm.de----------------------------
DeltaVee
DeltaVee
Yes.



D.V.
D.V.Carpe Die<FONT C
VolkerG
VolkerG
You can control it with your perspective projection matrix. When you use one of the D3DXMatrixPerspective* function (DX7 and up) the near and far clipping planes (zn and zf) are the parameters you''re looking for.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.