Height Maps and Pixel Displacement in Unity’s HDRP

Alberto Garcia
2 min readMay 30, 2023

--

Height Maps are used to mark elevated and deep areas of a texture matching in shape it’s normal map as a grayscale version to create the displacement. This effect on HDRP shaders is heavy on graphics but can create a very realistic looking environment by giving bumps to flat surfaces, like a stone road that has natural bumps in flat ground.

To create a Height Map using an image editing tool like GIMP, the normal map must be changed to black and white (grayscale) in order to detail out the areas that should remain low and bright to reveal the elevated areas of the texture. for this example, the fat rocks should be brighter than the dark lines inbetween them. Adding more contrast will make this deformations more noticeable and also smoothing out the darkness inside the bright areas.

Inside the Surface Options of this material, select Displacement Mode to Pixel Displacement

And inside Surface Inputs place the new grayscale texture as the Height Map (or Bump Map).

Tweaking the amplitude will displace the elevation and depth visual effect for this texture. An amplitude of 2 seems to be fit for this case.

On the other hand, Vertex Displacements takes into account the vertices lines that form the polygonal shape of this plane and create an elevated terrain in a different order.

Vertex Displacement

--

--

Alberto Garcia
Alberto Garcia

No responses yet