Tessellation in HDRP
Make your flat textures come to life!
Objective: Learn what Tessellation is, how it works, and how to apply it in Unity.
What is Tessellation and How Does it Work?
Tessellation is a Shader that adds subdivisions to flat objects to cause organic displacement and change its geometry to 3D. Unlike Height mapping with pixel displacement, tessellation actually physically changes the object. However, be aware that his physical change can be very expensive as the subdivisions are essentially adding more vertices to make the object more malleable.
→Use it for: Tessellation is best used on flat objects that need more organic variation like grounds and cobblestone paths. If you have a plane set as your ground object, you can add uneven terrain which will match perfectly with a nature-filled environment,
→Avoid: Regular 3D objects simply fall apart when Tessellation is used on them. The idea is to turn flat surfaces, like planes, into 3D objects, doing this on an already 3D object doesn’t translate well.
How to Add Tessellation in Unity HDRP?
For this example, I will be using a Cobblestone texture that you can find here:
Make sure to pick it up if you want to follow along! Although I won’t be using the material because that one is already complete with mapping, I will be making use of its Diffuse Texture, Normal Map, and Height Map.
- After downloading and importing the texture pack, drag and drop the Diffuse Texture onto a plane object. The diffuse texture is our default regular texture, this holds the structure and color information of an object, kind of like placing a sticker over a flat surface.
This texture already looks pretty good, but a side view reveals just how flat it is. Let’s fix that!
2. Add the normal map texture, this will manipulate the lighting of the object to project more organic crevices and bumps.
Note: This will not change its geometry, it will simply create the illusion of depth.
3. To use Tesselation, we need to change the Shader type, this will enable the Tessalate Displacement option.
4. Change the Displacement type to Tesselation, this will give us access to Height Map options that use Tessellation along with their mapping to modify the geometry of our object.
5. The texture pack also included a Height Map, which we can use now that the displacement type is set.
Note: If you want to learn more about Height Maps — what they are, how they work, and how you can create one check this out!
6. In this example, we’ll be focusing on two core values: The Tessellation Factor and the Max Parameter.
If you want to learn about all the other Parameters, you can check out Unity’s Official Docs.
The Tesselation Factor refers to the number of subdivisions the triangles on your surface will have. I personally set mine to 28.
To see this more clearly, toggle Shaded Wireframe to see how the subdivisions form.
7. Even with tesselation on, the change appears to be subtle, this is due to the Parameterization. This set of values is responsible for setting a parameter on how much height(how much protrusion)the Tesselation can reach. By increasing this value, you can see how the cobblestones really rise! (Kind of reminds me of bread baking in the oven 🤔)
Bonus Step: Just to really make everything come together, the texture pack included a Roughness Map. When appplied to the Mask Map, you can really see how it brings out the detail!
The Result:
Thank you for your time! If you found this information valuable give me a follow! :) I document my learning journey into Unity Development and Software Engineering in the form of tutorials!