Z-buffer problem

Started by
9 comments, last by Xtremehobo 20 years, 10 months ago
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!
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
Advertisement
That looks more like Z-fighting than a culling problem.
Yea I was thinking about that too. Doesn''t Z-Fighting only occure when you''ve got multiple triangles in the same place?
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
If you zoom in towards that artifact, does it go away?
well, sometimes SOME artifacts will go away when I change positions or zoom in, but in this case, it won''t
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
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.
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 :-\
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
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.

I''ve outputed all of my vertice''s X, Y, and Z values to the debug console and checked them over. They all look as they should :-\
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
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]
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement