Game Development Community

Atlas texture errors at tiled edge.

by Bill Vee · in Torque Game Engine Advanced · 11/14/2007 (6:08 am) · 3 replies

If you use a couple of atlas files tiled together to represent a very large area the seam between them is being blended in code to try and produce a seamless effect.
It appears the clipmap ,or some other aspect of the atlas code, is sampling from the opposite side of the terrain in an attempt to properly blend the two terrains together. In most cases the seam is ok at the highest detail level but the further away you get away from the seam and force the atlas to switch to lower and lower detail levels the seam becomes very apparent. It is very bad on terrains that have a lightmap applied to it.
This problem has been discussed by others here.
They have posted some images of the problem as well.

The consensus is maybe adding a script function to not to apply the blending for the outer edge of a terrain.

Not sure if this helps but..
In AtlasClipMapImageCache_Blender::dorecupdate() there is some code that corrects the seam between different chunks that is very similar to the edge seam problem. It basically extends th uv's out a little to make them lineup better. Without this code it produces terrain that have seams around every chunk.

#1
11/15/2007 (7:09 am)
After a closer look at the clipmap code and this article by Thomas Buscaglia it would appear that the effect is caused by the clipmap wrapping the virtual texture.

Should be easy enough to correct.
I need to study it more.
#2
11/19/2007 (10:44 am)
Keep us posted on your findings. This has been a thorn in my side as well, but havent had a chance to really look at it.
#3
11/20/2007 (5:25 am)
At this point I believe it is a problem with how the clipmap treats the virtual texture.
The code goes to great lengths to correct the issue of seams between chunks but when it comes to the lowest LOD chunk it appears to not adjust the extents or just gets it wrong. Same thing happens on chunks that are on the edge of a terrain.
Most of the adjustments are happening in the AtlasClipMapImageCache_Blender::dorecupdate() code.
I have made simple changes to some code here that removes the outer seam but creates issues with the inner seams. Its just a matter of creating the right logical code right now I think.