Skip to main content
gamedev.net
🔒 Locked

Z buffer problem

Started by Megatron Dec 12, 2001 at 4:51 PM 0 replies 200+ views
Original Post
Megatron
Megatron
I''m having some crazy things happen to me. It all started when I upgraded to SDK 8.1. I''m using transformed and untransformed vertices, and I''m rendering in this order: background, foreground, alpha-texture, untransformed vertices. The strange thing is, when I recompiled with SDK8.1, it wouldn''t show my transformed vertices unless I set the z coordinate to 0.0, whereas before I had them set to 1.0. But when I do get them to show, they cover up my untransformed vertices. When I render my untransformed stuff first, the alpha texture (transformed) goes over it properly, but the other textures completely blot it out. Any ideas? It''s driving me nuts.
FantasyGuy
FantasyGuy
First of all, you can try to use w buffering instead just to make sure the problem is in z buffering. Second, the need to set the z value to 0 instead of 1 means that the z buffer is already filled with the value of 1. One possible cause is the projection matrix. If you set the near clipping plane (Zn) to 0, you''ll get all the vertices'' z value normalized to 1 causing a lot of headache with the z buffer.

Topic Locked

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

Sign in to reply to this topic.