How are the normal maps created?

Some game engines create a normal map from an imported heightmap and use that for terrain shading. My gues would be that they do some sort of central differencing, where basically calculate a gradient from neightboring points.

Now: How does World Machine do it (normal map maker node)? Does it apply the same thing with the same resolution (meaning I wouldn’t get any benefit if I create a normal map in WM if it has the same resolution as the heightmap)? Or is the precision higher than that?

I’m interested in knowing this too.

My guess would be that normal maps always has some extra information

For a heightmap it uses greyscale colors: 2 tones to build a map
And for a normal map it uses 3 colors wich means more precised calculations

dont know if this makes any sence
Its just a thought

A heightmap usually is a single channel greyscale, not sure whatyou mean by two tones, maybe the two byte per pixel for a 16bit heightmap?
The three channels of the normal map just store the three xyz coordinates of the normal vector, and it usually is stored at the same reolution (like 1024x1024) as the heightmap. The question is if WM calcuöates the normal using neighboring pixels of the heightmap data (like the game engines do), or since it principall. Has access to more information during building, if the accuracy is heigher than that.

Hey Jesse, know you from the C4 forums (where I go by the name of Rastar) :slight_smile:

Normal maps generated from a heightmap are incapable of the same fidelity as one generated from a similarly resolute polygonal mesh. This is due to the nature of determining height from a heightmap - neighbor sampling and noting relative distance. This preserves continuity but at the cost of diminishing drastic shifts in slope, which are often necessary details desirable in a normal map. A normal map baked from a polygonal source is superior, since its simply a raytrace from precisely the pixel point on the mesh.

Glad to see a familiar face here, hhildebr! :smiley:

Hi there,

World Machine does not have any additional knowledge of the terrain that is not contained within the heightfield. Although this is theoretically possible with a fully analytic terrain, as soon as any kind of grid-based simulation or other types of effects are performed the sampling theorem rears its head…

Note that this also means that numerical differentiation of the heightfield IS the highest fidelity source of normal information that we have – all we know of the terrain height is a regular grid of samples. Because of this, any sharp edges imposed by the triangulation of the terrain are frequencies higher than what can be represented by the grid and do not actually represent real features in a WM terrain.

… short answer: You should get roughly comparable normals in WM or your end-app. The exception of course, would be if you generated your world at a higher resolution than the heightfield is exported at – for example, a 4096x4096 build and normal map export, but a 1024x1024 heightmap export.

igepezu@email.namnerbca.com

tijiabeyo@email.namnerbca.com