Problem with edge of Mega terrain
by Dennis Trevillyan · in Torque Game Engine Advanced · 10/22/2009 (10:16 pm) · 4 replies
After creating a megaterrain using the terrain editor I've run into a problem. Some of the edges have a "wall" remaining which can't be eliminated. I've tried to set the height, smooth it out, etc. with no effect.

Any ideas how to get rid of this wall?

Any ideas how to get rid of this wall?
#2
10/22/2009 (11:51 pm)
So does that make it a trivial change to just wrap one less vertex in each direction?
#3
Daniel, I don't think so. This would most likely leave some blank spots in the terrain, assuming it didn't crash the engine. The task is to determine if it is a free edge, ie: not joining another tile, and then not allow it to wrap. The problem is that the height at this node is undefined so you need to find a way to establish the correct height.
Thanks!
10/23/2009 (12:05 am)
Rene, good point. I hadn't considered that. I'll look to see if this what is happening.Daniel, I don't think so. This would most likely leave some blank spots in the terrain, assuming it didn't crash the engine. The task is to determine if it is a free edge, ie: not joining another tile, and then not allow it to wrap. The problem is that the height at this node is undefined so you need to find a way to establish the correct height.
Thanks!
#4
10/23/2009 (2:46 pm)
It is non-trivial to make it not render that last edge.
Associate Rene Damm
Looks like the edge mirroring problem. Does the terrain line you see there mirror the height data you see on the opposite edge?
One thing that legacy terrain (and thus MegaTerrains) does is it mirrors edges across to the other side. This is a remnant of the infinite tiling from the Tribes days.
Unfortunately, AFAIK there's nothing that can be done about this besides going in and hacking the code. The code as is will step 257 vertices in either direction whereas the heightmaps are only 256 samples across each edge. As the indexing is programmed to automatically wrap around, index #256 on either axis will wrap around to #0.