Smoothing a height map

Dear jogl developers,

at the moment i develop a jogl application which is using a height map with quads.
For the height map i calculated the normals which looks faceted when i use the specular lightening.
I smoothed this a bit by calculating the averaged sum of the adjacent normals for each quad.
This looks much more better but maybe there is a better method available to make the quads look much more
less faceted.

Any help or suggestion is appreciated

Use normalmaps

triangles instead of quads would help you here too…

But yes, normal maps would go much further in improving the visual quality.

DP :slight_smile:

Thanks for the suggestions.
I will have a look at it.

if it is of any help, i wrote a cpp application once that can smooth heightmaps stored as TGAs:

http://www.embege.com/fractals/mdterrain/

Looks nice emzic

But I have to generate the terrain from real data.
I guess you’ve used triangles instead of quads for the height map, right?
I would be also interested in to hear how you’ve realized the smoothing of the data.

Don’t know if you already doing this, but double check that you are using the same normal for overlapping vertices.

Yes, and when you already tried everything suggested above you may consider using a noise function to get more detail.

If your mesh is a regular grid just increase its size and interpolate the vertices which do not hit a sample of your height map. Additionally add for each vertex’ height value the noise of your function (eg perlinNoise2D(vertex.x, vertex.z)) with a fine amplitude.

it might look like that (note: this is no regular grid)

(you may also use the noise for the normalmap to add even more detail…)

Thank you all for the suggestions.
I really appreciated your help!