# Soft filtering edge of tilebase Terrain

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

## Recommended Posts

Hi , I'm learning about tile base map with elevation(height).
I succeed in render the map with diamonded tile, or using Ortho-isometric View to make square tile become diamonded (There are 2 methods, the first is mostly use 2d tile texture)!

My current test is like this (2nd Method) (The lighting is a bit wrong, but the biggest problem is the edge) :

So I move to the next level with height. I referenced this, and so wonder how can they do it! what is the technique!

In the old game, I think they dont use texture like this, but draw everything in 2D and add the light shading that make it looked 3d. In this HD version, i think they move all the terrain to full HD, so we can see the wireframe. So what I really want to know is how to achieve this, or what is the technique behind this achievement. I assume that they try to interpolate 1 poly into many small poly for smoothment, but that will reduce the performance, and anyhow i dont know which algrorith let us do this interpolation. Thanks all. Edited by greenpig83

##### Share on other sites

It doesn't look like there is any LOD here. It's probably just one vertex per point in the height map. Then they triangulate each square along the line between the two vertices that differ least in height.

##### Share on other sites

LOD you mean Level of Detail. Havent work with LOD before, so I will spend some time research it. So now you mention HeightMap, and I saw many ppl use it for terrain. I will try to make a demo with heightmap. I hope I can get the result I want. I'll post the result right after I finish it . Thanks .

FurtherMore, in the note of the game Development Diary. They say the use "Soft filtering and noise for terrain lighting ', but I don't really understand what it means. This is a specific technique ?

Edited by greenpig83

##### Share on other sites
I only mentioned LOD because you said "I assume that they try to interpolate 1 poly into many small poly for smoothment". For this type of overhead view, you don't need to bother with LOD, since the terrain is all roughly the same distance from the camera.

"Soft filtering and noise for terrain lighting" -> I don't know what this is either. It just sounds like a bunch of buzzwords put in a sentence. It's difficult to say without more context. Do you have a link? Edited by phil_t

##### Share on other sites

I only mentioned LOD because you said "I assume that they try to interpolate 1 poly into many small poly for smoothment". For this type of overhead view, you don't need to bother with LOD, since the terrain is all roughly the same distance from the camera.

"Soft filtering and noise for terrain lighting" -> I don't know what this is either. It just sounds like a bunch of buzzwords put in a sentence. It's difficult to say without more context. Do you have a link?

Yes , here is the link. Thanks for the answer.  http://www.ageofempires.com/age2.html  (search for noise)

I'm working with the heightMap solution now. Divide each tile into smaller one. assign the height of it.  Render all of them together.

Trying use this : http://www.nfostergames.com/lessons/TerrainSmoothing.htm  for smoothing. But the result is quite different from what I expected. It only smooth surround the elevated tile. Not the tiles surround it.

Maybe I understand the algorith wrong, or fail to apply!

Edited by greenpig83

##### Share on other sites

The noise they are referring to is probably a perlin noise texture that is used to determine which of two textures to sample from in the pixel shader. If you look at the grass closely it looks "randomly patchy". So it's likely two textures, and a third texture (the perlin noise) is used to determine how much from each of the two source textures is used in the final output. This is usually referred to as multitexturing.

The soft filtering, I'm guessing, refers to the smooth transition from grass to dirt (or whatever) along the tile edges. This is yet another level of multi-texturing, probably using another "mask" texture that has different "shapes" in it for the different neighbouring patterns of tiles (instead of the noise texture).

##### Share on other sites

Trying use this : http://www.nfostergames.com/lessons/TerrainSmoothing.htm  for smoothing. But the result is quite different from what I expected. It only smooth surround the elevated tile. Not the tiles surround it.

It looks like you need to do multiple passes in order to get the smoothing to "spread out" farther.

##### Share on other sites

Here the result that I work with HeightMap (not really HeightMap, i dont use any gray image for height or anything. But I think it's the same in idea, cause I have a NxM height map )

Searching all day for a good example of B-Sline surface, Bezier surface, CoxDeBoor algorithm, NURBS... Hard to find an an easy example work for this case. Most of them the surface not going through the control point. In this case I want my surface to go through the Points. So I decide to go the no-brain way, draw a curves n*(n*n) curve throught points in the map. And it does work as I expected. However with those triangle, I think it will hit the performance a lot (The demo now run at 44 fps, ofcourse there is no optimize at the moment, but my Comp can run Crysis 3 at 60fps ) . Because I will have to render hundred of tile on screen.

For the curve I use D3DXVec3CatmullRom to create a curve go through 4 control points.

Edited by greenpig83

##### Share on other sites

The noise they are referring to is probably a perlin noise texture that is used to determine which of two textures to sample from in the pixel shader. If you look at the grass closely it looks "randomly patchy". So it's likely two textures, and a third texture (the perlin noise) is used to determine how much from each of the two source textures is used in the final output. This is usually referred to as multitexturing.

The soft filtering, I'm guessing, refers to the smooth transition from grass to dirt (or whatever) along the tile edges. This is yet another level of multi-texturing, probably using another "mask" texture that has different "shapes" in it for the different neighbouring patterns of tiles (instead of the noise texture).

I know about perlin noise, it used to create natural thing like cloudy, grass, fire... even generate random Map. So i think it has nothing to do with smooth.

About the smooth transitions between tiles, It's about blending , and there are tons of artile about it, so I thinks it's not very hard. After working with smooth edge, I'll move to the blending issue. I think it will be alot easier than softing this edge.

Anyway, I'm still not sure this is the best approach, I think there will be a better (in performance, or visual quality). So if any one can enlight me, I will really appreciate it. I will post anything that I found here.

Edited by greenpig83

##### Share on other sites

How do you calculate the normals for your quads? Just inside the quad or with corresponding neighbours? Your first screen looks like first option.

When you calculate a normal for one heightmap point by all 4 triangles, which use the same point, you should get a smooth shading.

*---*
|\ /|
| P |
|/ \|
*---*


1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631433
• Total Posts
3000046
×