Skip to main content
gamedev.net
🔒 Locked

Black Line Problem

Started by rocketscientist_69 2 replies 300+ views
Original Post
rocketscientist_69
rocketscientist_69
Something appears to be wrong with my game - i am using VB to write a DX7ImmediateMode FPS. Where two polygons meet, there is a small black line. Any ideas??? I know this is a common problem, however i can''t find any tutorials anywhere.
Serge K
Serge K
Usually it''s a sign of a T-junction, when some polygons don''t share all vertexes on a common edge.
JoeyBlow2
JoeyBlow2
Due to floating point inaccuracies, a dot (vertex) at 5.00000 could sometimes be 5.0000001 or 4.999999998. This causes the line to randomly appear and disappear.

The only way to fix it is to overlap the polygons a bit (but that can cause z fighting problems as a side effect)

What I personally do is turn off the "clear" command from wiping the screen. I always render out the entire screen anyways covering everything so the clear doesn''t matter. That way when this happens, the previous contents that where there hide the line and you don''t notice the line.
kill
kill
Actually, that''s not the case. If the two triangle''s edges shade the vertices the error accumulation is the same for both triangles, so eventhough they''re not rendered correctly, it still looks right (you don''t see the line because BOTH triangles are rendered with the same error).

Topic Locked

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

Sign in to reply to this topic.