In graphics programming, even at high level, there are a lot of terms and definitions that need to be understood. This learning curve is steepened by the fact that different game engines can have different implementations and interpretations of the underlying technology and will use these terms in subtly different ways.
This page is a glossary of common shader development terminology, explained in plain English with minimal assumed knowledge. It is intended to be used as a companion guide to help elucidate other shader development articles/tutorials.
Most of my shader development experience has involved working as a technical and visual effects artist, bouncing between Unreal Engine and Unity. Although I will do my best to make these terms as engine-agnostic as possible, my approach will necessarily be through the lens of that experience. Just something to keep in mind.
What is a Shader?
A shader is a series of instructions and inputs that will dictate a rendered object’s appearance. This includes, but isn’t limited to, the object’s color, translucency, shape, position, and how light reacts to its surface.
A range of different types of variable can be defined within a shader. Some of the more common include scalar variables (a single numeric value), texture maps, and vectors, which can be interpreted as a color, position, or direction.
By declaring Properties, shader artists can allow users to set their own values to change how the surface is rendered. This is an important component of the creation of Master Materials, which are explained in more detail below.
Depending on the graphics API your game engine is using, shaders are most commonly developed in one of two languages: HLSL for DirectX, or GLSL with OpenGL. When you package/build your game project your HLSL/GLSL shaders will be compiled to support the specific platforms you have chosen. Depending on your target hardware this can get a little complicated, but most commercial game engines will handle this for you.
Both Unity and Unreal provide node-based visual programming editors through which you can create and edit shaders. These tools will abstract the code-writing aspect of shader development behind a node graph, which can make the process much easier to understand. Behind the scenes, the engine will be taking those nodes and generating the code for the user.
In Unreal Engine, shaders are created at the same time as materials, and the terms are sometimes (and incorrectly) used interchangeably. This is because the frontend of the Unreal Material Editor merges the two together, and outputs a node-based version of an HLSL shader and a material that can be applied to objects in the game world as a single asset.
For more information on this distinction, see my Seven Tricks to Speed Up Shader Compilation in Unreal Engine 4 article.
Shader development is a wonderful rabbit hole. If you’d like to learn more about creating shaders using visual programming in either Unreal or Unity I highly recommend checking out Ben Cloward’s new Shader Graph Basics series on YouTube. He’ll take you through the entire process in both engines.
If you’re more interested in the nuts and bolts of HLSL, have a look at the Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe. It’s still a work in progress, but it’s a great place to start.
What is a Material?
A Material is an asset that, when combined with a shader and a selection of input values, can be applied to an object to change the properties of its surface. Unlike shaders, materials can be created and modified at runtime.
One significant point of difference between Unity and Unreal is that in the latter, materials and shaders are created at the same time. This means that in Unreal a Material cannot be edited outside of the Material Editor, except through the creation of Material Instances.
To put it another way: In practical terms Unity Materials and Unreal Material Instances serve the same function.
A Material in Unity (left) and a Material Instance in Unreal.
What is a Master Material?
A Master Material is a term most commonly used within the Unreal Engine community to describe a particularly versatile material/shader combination that utilizes a host of configurable parameters to support a wide range of possible surface properties.
A Master Material may have dozens of configurable options, often gated so the engine does not need to compile branches of the shader that a particular instance of the Material doesn’t require.
In Unity the default Standard shader could be considered a ‘Master Material’, although the language is now getting a little confusing, and Unity developers tend not to use the term as ‘Master’ means something else in the Shader Graph.
For more information on the creation and application of Master Materials, check out my post The Anatomy of an Unreal Engine Master Material, which looks at a practical example step-by-step.
Watch this space!
This page is intended to act as a way to share some common terms between my articles here on techarthub. At this time I’m using it more or less exclusively to explain, in simple terms, the differences between materials and shaders for an upcoming article on Master Material development.
As my website continues to grow, I will come back and update this page with more terminology as it becomes relevant to the resources I have made available.
Thanks a lot for reading.