Tessellation of Unity Materials
Using the High Definition Rendering Pipeline
Yesterday’s article talked about the two Displacement types for our materials. Alternatively, we can dive into Tessellation of our material using a different Shader!
Tessellation in the terms of computer graphics and programming, is the dividing of a surface into multiple polygons for more enhanced rendering. Using the High Definition Rendering Pipeline (HDRP), we can make use of these polygons for Displacement, allowing for a smoother iteration than our two previous types discussed.
To make use of Tessellation we need to change our Shader to Lit Tessellation. This is very similar to our standard Lit Shader, but we gain access to two different modes of Tessellation. These modes are none and phong. As with our previous forms of displacement, we need to provide a Height Map to allow for tessellation to occur, although, using phong mode, this becomes optional, as phong tessellation applies vertex interpolation to smooth out our material, regardless of a height map or not. Ultimately phong is our best option, but it’s good to still be able to apply displacement without a height map and achieve pretty nice results.
To start seeing the effect, we can alter our Amplitude or MinMax values depending on what Parametrization mode we select.
On top of this, we can also set our fade distances for when the effect becomes visibly rendered, but more importantly, our triangle size and shape factor. These reflect the size of which triangles Unity starts to tessellate, as well as how spherical the mesh becomes.
The idea of a smoother iteration as mentioned earlier, comes with a drawcard. Our two basic types of displacement keep the vertices of the original surface, with Vertex Displacement making use of these, and Pixel Displacement taking from the texture itself. But using Tessellation subdivides our surface into many, many vertices. While this allows us to alter the surface in a more realistic sense, we also have a lot more to render, thus, it can be pretty taxing on our performance.
Once again, with many other elements of game development, it comes down to scope as to what displacement method we wish to use. Tessellation can be expensive, but used in the right places can really bring a scene to life!