• ### Announcements

#### Archived

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

# incredibly annoying visual artifacts in heightmap-generated terrain

## Recommended Posts

I''ve been trying for several hours to figure out why I get pixels of the background color jumping around along the edges of my terrain where one big quad (generated from the heightmap) and a mesh of smaller quads meet. i''ve tried increasing the depth buffer, tweaking the clip planes, scaling the terrain, messing with gloffset, etc. etc. the blue pixels constantly flicker on and off all along the border between the large quads and the mesh of small ones It seems like it has something to do with the z buffer and not enough precision, but I''ve tried a whole slew of things that should fix that, and none of them lessn it a bit suggestions?

##### Share on other sites
u mean (a,b,c) vertices
---A-||  B-|---C-|

you will have to break up the larger quad ie it will have to use the vertices AC+B (not just A+C)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

##### Share on other sites
if i understand your problem correctly, you are using some form of LOD, and gaps appear. These gaps NEED to be filled up using geometry. They appear because the terrain is not linear between A and C in zedzeek''s diagram. So you have to compensate by filling the gaps with triangles. It is not a problem caused by depth buffer etc. Filling them depends on what algorithm you are using to do the LOD in the first place.

##### Share on other sites
well yes.. as rudimentary as the code is, it is a form of LOD
basically imagine a huge say 16x16 unit quad mesh, and im breaking it up into 4x4s
so i literally covered up every gap (i.e. i "glued" each vertex of the 4x4 bounding the 16x16 onto it")
there are no big gaps... just a few pixels here and there along the line between the big quads and little quads that shimmer and jump along the line when i move.. i can literally cover it up with a line, but then that adds a whole new slew of bad visual artifacts

hope this helps

##### Share on other sites
i just remembered the name of the problem ''t-junction''
heres the same problem with quake3
http://fps.brainerd.net/sparklestut.htm
u can fix it by sharing ALL the vertices that border both polygons

ie for the above example break the large polygon into 3 triangles 1 big + 2 smaller

----|\|_||/|_|

http://uk.geocities.com/sloppyturds/gotterdammerung.html

##### Share on other sites
Ah, thanks a lot! problem solved. its amazing how far i got without knowing something fundamental about the ways things are drawn
well, lesson learned, thx for the tip

• ### Forum Statistics

• Total Topics
627735
• Total Posts
2978854

• 10
• 10
• 21
• 14
• 12