Unity Height Maps and Pixel Displacement

Thomas Mauro
4 min readSep 10, 2022

--

Now we are in Unity HDRP, and one of the purposes of this rendering pipeline is to bring more realism to the overall project. Hight Maps and Pixel Displacement can be used on an object to give it more detail. An example can be an asset with a rock-like texture. If you want some amazing free textures then you need to check out Poly Haven.

So for this, I brought in a stone-like asset to learn some basics. Since the stone came in as Standart I of course switched it to HDRP.

  • Material Selected
  • Edit/Rendering/Materials/Convert Selected Built-in Materials to HDRP

Once that was converted I noticed the material now had its rocky look to it plus there was a Mask Map generated. I did this process first to make sure it worked. I will show a demo with another rocky material.

This shows the part that was cut off in the above depiction

Now I can use this material on an object. I will start with an empty 3D Plane and add this texture to it to start off.

  • In hierarchy Left Click — 3D Object — Plane
  • Set the object to be visible to start working on it
  • Drag and Drop the material onto the 3 Plane

With the light shining more on the material it seemed a bit too bright so I just gave it a bit of gray. And tested with that a bit.

Even though this is still just a flat object a simple adjustment of the Smoothness Rema can bring some life to it. Also changing the directional light to sim different times of day will let you see how it looks in those different light settings. There are other options to mess around with to get it just how you want it or need it to be for your client or job.

Whoa, this has much more realism with just those few adjustments.

Those basic settings and bringing the material to HDRP alone make a big difference, but there is more! Let us get into mesh deformation using Vertex or Pixel displacement.

First, let's look at Displacement Mode. There are two options, Vertex, and pixel Displacement, but we need a height map to use this correctly. Had to break out the Photoshop for this one.

  • Opened Photoshop
  • Right-click on the Original Diffuse texture/Show in Explorer
  • Drag and drop the Original Diffuse texture into Photoshop
  • Once in PS go to Filter/3d/Generate Bump Map/Select Okay
  • The image was a bit dark so I went to Image/Auto Contrast
  • I then saved the file and put height in its name

The difference is huge. I will show what happens when putting on Pixel Displacement Mode with the new height Map in place it can really start adding even more realism.

The first time you put it in a Displacement mode you will see the height Map option open to drag and drop the new height Map into.
The Amplitude setting is one you will want to play with

The other option for this is the Vertex Displacement. Same this really. Set it, then get the setting to how you want or need for that object texture.

In the Vertex Displacement mode, you have Amplitute and Min/Max Parametrization options to play with. In the GIF below I already set the MIN/MAX and will show what happens when adjusting the Amplitude.

Playing with some Vertex Displacement settings.

The next thing to get into will be Tessellation in HDRP. Wish I can continue on, but one must rest to be ready for work.

--

--