Archived

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

Z-buffer problem

This topic is 5277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As you can see, there's a strange problem there :-When I declare my indices, I do it clockwise and I'm using clockwise culling. as showin in the picture, things from behind that one 'mountain' are rendering and I don't want this. How do I aoid this? Do I have to change some sort of setting, or declare indices in a different order? Thanks, Matt ----- GSACP: GameDev Society Against Crap Posting To join: Put these lines in your signature and don't post crap!

Share this post


Link to post
Share on other sites
The it''s probably not a Z-fighting issue then. As objects get closer to your front plane, you typically have more Z precision so any fighting issues would tend to go away.

What about when you rotate that entire terrain model? Does the artifact remain in its same position relative to the larger mountain?

What I''m trying to get at is, could this possibly a problem with the position data in your vertices? Since it''s the back corner coming through the rest of the image, is this perhaps the last 50 or so vertices in your vertex buffer, or maybe the first 50? Could you have a rollover problem in your code that generates the vertices that would create incorrect Z values? If this problem is in your vertex data, you should be able to rotate the image and the artifact will be in the same position relative to larger mountain.

Share this post


Link to post
Share on other sites
yes, it is staying in the same place realitive to the larger mountain. I don''t think its a problem with the vertices Z values though because I have some simple code that just generates a grid of vertices and I''ve looked at the actual values and they are as should be :-\

Share this post


Link to post
Share on other sites
Well it could be the X or Y values that are wrong. It depends on the position of the model within the view.

You could find out pretty easily by using ProcessVertices and then looking at the resulting vertex position in the destination vertex buffer.

Share this post


Link to post
Share on other sites
first: i doesnt look like youre rendering back to front and obviously your not using depth testing. the picture looks like the hill in the background is rendered _after_ the mountain and without depth testing its just drawn on top.

also: those lines look typical for using trangle strips and starting each row on the same side which cant work without artifacts.

and what about culling? culling isnt the problem. frustum culling hasnt got anything to do with it and backface culling is obviously working (seen on the right side)

[edited by - Trienco on July 6, 2003 3:56:46 AM]

Share this post


Link to post
Share on other sites