TextMesh Pro: Shaders and Material Properties
Tutorial
·
Beginner
·
+10XP
·
10 mins
·
(78)
Unity Technologies

In this tutorial, you will learn about the different Shaders and Material Properties in TextMesh Pro
Languages available:
1. Introduction
This tutorial has been verified using Unity 2019.4 LTS and TextMeshPro v2.1.1
Fonts can have Materials just like ordinary GameObjects in Unity. These Materials are powered by Shaders, which dictate the available visual properties.
This workflow will provide an overview of the Shaders packaged with TextMesh Pro and provide a brief rationale as to why you might want to use one over the others.

For a more detailed overview of all the properties, each Shader provides, please take a look at the documentation.
2. The Different Types of Shaders
Mobile and default
Each TextMesh Pro Shader contains a mobile variant optimized for performance on lower spec devices, such as tablets and mobile phones. For the purpose of this workflow, we will be working with the standard variant of each Shader so all the properties of each will be available for us to use. Note: There are no surface Shader variants for mobile Shaders. Text rendered with this Shader will subsequently not be affected by lighting.
Bitmap
The old standard for rendering text in a rasterized manner. This is useful if you want to render text in a 1:1 ratio (for instance,on a small mobile device, you might want a 16pt font to occupy only 16px on the screen).
Distance Field
Signed Distance Fields are the new standard for rendering text. This allows for crisper, more scalable text to be displayed independent of target resolution. It also allows support for effects, such as outlines, bevels, and glow. The default version of the Shader does not allow text to be affected by Scene lighting.
Distance Field (Surface)
This variant of the SDF Shader allows text to be affected by Scene lighting. This is useful for diegetic text that exists within the Scene’s world.
Distance Field Overlay
A variant of the SDF Shader that is unaffected by Scene lighting.
Sprite
This option conforms Sprites to the shape of the characters defined in the Font Atlas.
3. General Guidelines and Additional Considerations
It’s good practice to always create a new Material Preset for each Font Atlas. This level of distribution allows for greater customization per Atlas. It also encourages developers to never modify the default Material. The default Material is TextMesh Pro’s “factory default,” so to speak, so under most circumstances, it’s best not to modify it.