Archived

This topic is now archived and is closed to further replies.

Megatron

Z buffer problem

Recommended Posts

Megatron    122
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.

Share this post


Link to post
Share on other sites
FantasyGuy    122
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.

Share this post


Link to post
Share on other sites