Archived

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

How to eliminate the terrain staircase effect

This topic is 5002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey All, I’ve implemented a CLOD terrain engine using geomipmapping. Everything is fine except for one problem. When I render a very hilly/mountainous scene, the terrain looks like a set of staircases on the slopes and not very natural. Especially when I’m at the highest level of detail (maximum number of vertices). However, with a less hilly/mountainous scene, there are no problems. Thank you in advance.

Share this post


Link to post
Share on other sites
You''re going to have to implement some kind of erosion function. This function should take your height map as an input parameter and do something like:

for( int x = 0; x < Size; ++x )
{
for( int z = 0; z < Size; ++z )
{
// The y value at (x,z) in the new height map
// equals the average of the y values of the same
// point in the old height map and the surrounding
// points.
}
}

How you define the surrounding values is up to you. I usually use a radius of one, that is (x,z) + (x+1, z) + (x, z+1).... and so on.
After that you can render your terrain from the new height map or set the old height map equal to the new height map. You will have to check to make sure that you arguments don''t read off the height map. Like if you x = 0, and you said x - 1.

Share this post


Link to post
Share on other sites
tolleyc> that won''t work well if the slope is really smooth, you will just smooth the stairs, not throw away the stair effect. it will still be visible. I tryed with catmull-rom, it''s much better, but still noticeable depending on the heightmap.

nullstate> I guess you''re using a standard 8 bit grayscale heightmap? the stair effect becomes noticeable because you''ve only got 255 heights between your terrain lowest possible point, and the heighest one. you need to use a 16 bpp heightmap, or load digital elevation model files, or load terragen files (really easy to load).

Share this post


Link to post
Share on other sites
Hey All,

Thank you for the quick responses. Currently I am already filtering the heightmap. However, I''ll give sBibi''s suggestion a try and increase the heightmap to 16bpp. I''ll let you know how it worked out once I implement it. Again, thank you guys for your suggestions and help!

NS

Share this post


Link to post
Share on other sites
Are you sure the res of the heightmap is high enough? If you get stepping that suggest that there are more than 1 vertex per pixel, and that doesn''t sound too good.. Don''t take my word for it thogh.. the only experience I have with terrain rendering is a roam demo/sourcecode that I downloaded and took a quick look at.. I''m still a noob
It might be worth to check out though.

Share this post


Link to post
Share on other sites
perhaps it is because you have a greater LOD than your heightmap can work with. if you have a heightmap with the size 256x256 and you have more than 8 LOD''s, there is no more detail. so a solution would be to simply interpolate the height between to pixels on the heightmap. you can do this linearly or using the cos. the best solution would be bezier patches or something like that to visualize resolutions greater than your heightmap has.

Share this post


Link to post
Share on other sites