Just what is a shader anyway?
In short - a shader is a post-processing effect.
A shader is a small program that runs at certain points during the rendering pipeline that makes changes according to its program. You can think of a shader as a processing pass - it takes the existing information from the game and processes things to produce some kind of different result, often some kind of visual effect. For example, it can take all shades of green on a character model and apply some kind of filter to them, distort them, blur them, modify transparency, brighten them, project some other source onto them like a green screen, or any of a number of other effects. Most shaders have a format like “every so often, for each thing that matches some (or all) of these specific conditions, do this to the thing”. This can be very powerful to add specific touches to specific elements like making metal more dully reflective, glass transparent but also refractive, or even things water volumes reacting to objects placed into them. Since they can run every frame, you can have real time post-processing effects like these:
Breath of the Wild’s cel shading (and what it looks like without the shader)
Unity’s toon water shader:
Making fur:
They can also be applied to specific objects like how this VFX has shaders to cause distortion on particles emitted from the model here:
The big takeaway is whenever you see somebody say “shader”, think “post processing effect”.
[Join us on Discord] and/or [Support us on Patreon]
The FANTa Project is being rebooted. [What is the FANTa project?]
Got a burning question you want answered?
- Short questions: Ask a Game Dev on Twitter
- Long questions: Ask a Game Dev on Tumblr
- Frequent Questions: The FAQ