When creating a subtree of components for the Height input, you should keep in mind three main concerns: visual quality, realism, and export quality.
Here's how to create a subtree for the Height input that minimizes clamping, high-frequency noise and other visual problems:
And a couple of additional tips that may save you valuable time:
Choosing correct height is essential for imitating real-world surfaces. The height map affects how light interacts with the surface, and natural-looking lighting is the key to realism. This is especially true in situations when surface lighting is rendered in real-time, for example, in a game engine. You should pay attention to the following:
The height is calculated as follows. The image produced by the component connected to Height is converted to grayscale by averaging its R, G and B channels (multiplied by the Alpha channel), and the resulting grayscale image defines the height: black image areas correspond to the height of 0, white areas correspond to the height equal to the global Size value, and the heights in-between are represented by intermediate levels of gray. Finally, the resulting height is multiplied by the value of the Surface Height parameter taken as a number within the range of 0 to 1.
You may think of height as a value measured in the same units as the global parameter Size – in pixels. For example, if the source image has the dimensions of 600 x 600 pixels, Size is set to 200 pixels, Surface Height is 10%, and all pixels of the height map are white, the resulting surface becomes a 'slab' with the dimensions of 600 x 600 x 20 pixels.
Here's how to apply this to choose a realistic height. Suppose you're creating a surface filter imitating a stucco wall. Let's assume that your target texture is square, has the dimensions of 512 x 512 pixels and corresponds to one square meter of real-world surface. Let's also assume that your real-world stucco has the depth range (the difference between the lowest and highest points) of 5 millimeters. If the Size slider is set to its maximum (in our case 512 pixels), and the brightness of the height map ranges from fully black to fully white, you will need to set the Surface Height value to 0.005 (5 millimeters / 1000 millimeters).
Alternatively, you may leave Surface Height at 100%, but in this case you'll need to make sure that the brightness of the height map pixels lies within the range of 0 to 0.005. However, this is not recommended because it reduces the dynamic range of the height map, which would lead to compression and quantization artifacts when the map is exported to a file and imported into a game engine.
If you plan to export the height / bump map for use in a 3D package or, especially, a game engine, it is recommended to keep the height map at full dynamic range (from black to white) and control the actual height of the surface with the Surface Height parameter (see above). Many file formats and texture compression methods may produce compression and quantization artifacts when the image pixels have low brightness values, so keeping the height map at full dynamic range minimizes these artifacts.