The 3D Handbook
Topic

Shaders for artists

What a shader is, how node-based material graphs in Unreal, Unity, Godot and Blender turn into shader code, the nodes environment artists use every day, how to judge instruction cost, what shader permutations are, and when to ask a technical artist.

shadersmaterialsengineoptimisation

A shader is a small program that runs on the graphics card and decides where each vertex goes and what colour each pixel ends up. Godot's manual defines them as "a special kind of program that runs on Graphics Processing Units" (Godot Engine documentation: Introduction to shaders). Every material you see in a game is a shader with some textures and values plugged in.

Environment artists rarely write shader code, but they build shaders all the time in node graphs. Knowing what happens underneath helps you make materials that look right, run fast, and do not surprise the programmers.

#What a shader does

A GPU runs the same small program on thousands of vertices or pixels at once. Godot notes that "graphics cards can run thousands of instructions in parallel", which is why shader code runs on each vertex or pixel separately and cannot remember anything between frames (Godot Engine documentation: Introduction to shaders).

For a 3D surface there are two stages that matter to artists (Godot Engine documentation: Introduction to shaders):

  • Vertex stage ("runs over all the vertices in the mesh"): moves vertices. Wind on foliage, vertex colour pass-through and world position offset happen in this stage.
  • Fragment (pixel) stage ("runs for every pixel covered by the mesh"): works out base colour, roughness, normal and the other surface values. Most material work happens here.

Lighting is calculated after (or inside) the fragment stage, using the values your material outputs. In a PBR engine you usually just provide base colour, metallic, roughness, normal and so on, and the engine does the lighting for you.

A simplified material node graph. On the left, a Texture Coordinate node feeds a Multiply node with a Tiling parameter. Its result feeds three Texture Sample nodes: base colour, normal and a packed ORM mask. The base colour goes through a Multiply with a Tint colour parameter. Outputs connect to the Base Color, Normal, Roughness, Metallic and Ambient Occlusion pins of an output node on the right. Parameters are outlined in orange. A note says three texture samples plus a few maths nodes.
A typical tiling material graph. Orange nodes are parameters an artist can change per instance; everything else is fixed logic that compiles into one shader.Diagram by the handbook author

#Material graphs in each tool

Node graphs are a visual way to write shader code. You connect boxes; the editor generates code and compiles it.

The Godot visual shader editor. Above, a preview of a black sphere with a bright rim around its edge. Below, a graph where Input nodes for normal and view feed a Fresnel node, whose result connects to the Albedo slot of the Output node.
A three-node visual shader in Godot: the normal and view vectors go into a Fresnel node, which the documentation calls "great for adding a rim-like lighting effect to objects", and its result drives the albedo. Screenshot from Godot.Godot Engine documentation (Juan Linietsky, Ariel Manzur and the Godot community), CC BY 3.0

#Nodes you will use every day

The names differ slightly between tools, but the same dozen nodes make up most environment materials:

Node What it does Typical use
Texture Sample Reads a texture at given UVs Every texture map
Texture Coordinate (UV) Gives the mesh's UVs Tiling, offset, second UV set
Multiply Multiplies values Tiling scale, tint, strength
Add / Subtract Adds or subtracts Offsets, combining masks
Lerp (Linear Interpolate / Mix) Blends A to B by an alpha Material blends, vertex painting and blending
Vertex Color Reads painted vertex colours Blend masks
Clamp / Saturate Limits to a range Keeping masks in 0 to 1
Power / Contrast Sharpens or softens a mask height blending, edge masks
One Minus 1 − x, inverts Flipping masks
Parameter (scalar, vector, texture) A value artists can change per instance Everything you want to tweak in instances
World Position / Normal Pixel position or facing direction triplanar and world-aligned mapping, dust on top surfaces
Fresnel Brighter at grazing angles Rim effects, wet sheen, dust

Most complex-looking materials are combinations of these nodes, for example a world-space normal mask, multiplied by a noise texture, sharpened with a power, used as a Lerp alpha.

Part of Jimmy Hammarsten's river material (ArtStation: Flowmap Water Shader – Houdini to Unreal…). Look for the everyday nodes from the table: texture samples, multiplies, adds and a Lerp that blends two samples of the same texture driven by a flow map. See water surfaces for what the effect does.Jimmy Hammarsten, via ArtStation

#Instruction cost

Every node adds work. The total is often shown as an instruction count, a rough measure of how much work each pixel or vertex needs. Pixel instructions matter most, because they run for every pixel the material covers.

Ways to judge cost:

Rules of thumb:

  • Do work once, early. Compute a mask once and reuse it for colour, roughness and normal.
  • Bake what never changes into textures. Matthew Trevelyan Johns at Naughty Dog described moving shader adjustments into the textures themselves to remove shader controls, "reducing the shader cost once more" (80 Level: Building Environments for Uncharted: The Lost…).
  • Watch the screen area. A heavy material on a small prop matters less than a slightly heavy one on the floor that fills half the screen.
  • Layered transparency adds up. Translucent surfaces and stacked decals shade the same pixels several times; see overdraw.

#Shader permutations

A single material can compile into many shaders. Every combination of on/off features, mesh types and lighting setups the engine needs gets its own compiled version, called a permutation (Unreal) or variant (Unity).

Unity explains that variants multiply: with ten sets of on/off keywords, "this results in 1024 variants" (Unity Manual: Shader variants). More variants mean longer builds, bigger files, more memory and longer loading (Unity Manual: Shader variants). In Unreal, static switch parameters are applied at compile time, and "a new Material is compiled for every combination of static parameters" used by instances (Unreal Engine documentation: Instanced Materials in Unreal Engine).

Permutations also have benefits. They let a material switch features off with no runtime cost: Unity notes they work "without the GPU performance impact of dynamic branching" (Unity Manual: Shader variants). In Epic's knowledge base thread, a reply argues that permutations often make individual shaders simpler and faster, and that the main costs are compile time, memory and switching between many shaders in one frame (Epic Developer Community Forums: Knowledge Base: Understanding Shader…). How to use them well is covered in master materials and instances.

#When to ask a technical artist

A technical artist (TA) sits between art and engineering; see roles in 3D game production. You do not need permission to build materials, but some situations deserve a conversation:

  • Before building a new master material that other artists will use. It is cheaper to agree on features up front than to rebuild later; see master materials and instances.
  • When the frame budget is tight and your area shows red or white in shader complexity.
  • When you need custom code, such as a Custom node in Unreal, an HLSL node in Unity or a hand-written Godot shader.
  • When compile times or shader counts grow sharply.
  • When something should work on every platform (consoles, mobile, VR), since each has different limits; Godot, for example, limits total uniform size per shader and per-instance uniforms to 16 per shader (Godot Engine documentation: Shading language).
The point where a graph turns into code: Isaac Oster's Niagara module uses hand-written HLSL to pick an animation, movement and orientation for each zombie in a crowd (ArtStation: Zombie Horde with Vertex Animated Textures…). Work like this is where an environment artist usually brings in a technical artist.Isaac Oster, via ArtStation

#In different tools

Tool Graph editor Reusable pieces Where to see cost
Unreal Engine Material Editor Material Functions, Material Instances (Unreal Engine documentation; Unreal Engine documentation) Stats panel, Platform Stats, Shader Complexity view (Unreal Engine documentation; Unreal Engine documentation)
Unity (URP/HDRP) Shader Graph (Unity documentation) Material Variants (Unity Manual) Variant counts after adding keywords (Unity Manual)
Godot 4 Visual Shader editor or text shaders (Godot Engine documentation) ShaderMaterial with uniforms (Godot Engine documentation) Generated code view
Blender Shader Editor (Blender Manual) Node groups Not meaningful for games; rebuild in engine

#Further reading and watching

Explains what vertex and pixel shaders do and where they sit in the rendering pipeline; the concepts apply to every engine. Watch on YouTube

References

  1. Godot Engine contributors · Introduction to shaders · Godot Engine documentation (source on GitHub) · docs · accessed 2026-10-21
  2. Epic Games · Unreal Engine Material Editor UI · Unreal Engine documentation · docs · accessed 2026-10-21
  3. Epic Games · Material Functions in Unreal Engine · Unreal Engine documentation · docs · accessed 2026-10-21
  4. Unity Technologies · About Shader Graph (17) · Unity documentation · docs · accessed 2026-10-21
  5. Godot Engine contributors · Using VisualShaders · Godot Engine documentation (source on GitHub) · docs · accessed 2026-10-21
  6. Blender Foundation · Shader Nodes: Introduction · Blender Manual (2.93), 2021 · docs · accessed 2026-10-21
  7. Blender Foundation · glTF 2.0 (import/export add-on) · Blender Manual (2.93), 2021 · docs · accessed 2026-10-21
  8. Jimmy Hammarsten · Flowmap Water Shader – Houdini to Unreal Engine 5 · ArtStation, 2025 · web · accessed 2026-10-22
  9. Epic Games · Viewport Modes in Unreal Engine · Unreal Engine documentation · docs · accessed 2026-10-21
  10. Matthew Trevelyan Johns (interviewed by Kirill Tokarev) · Building Environments for Uncharted: The Lost Legacy · 80 Level, 2017 · article · accessed 2026-10-21
  11. Unity Technologies · Shader variants · Unity Manual (Unity 6) · docs · accessed 2026-10-21
  12. Epic Games · Instanced Materials in Unreal Engine · Unreal Engine documentation · docs · accessed 2026-10-21
  13. Matt O. (Epic Games), with community replies · Knowledge Base: Understanding Shader Permutations · Epic Developer Community Forums, 2021 · forum · accessed 2026-10-21
  14. Godot Engine contributors · Shading language · Godot Engine documentation (source on GitHub) · docs · accessed 2026-10-21
  15. Isaac Oster · Zombie Horde with Vertex Animated Textures and HLSL in Niagara · ArtStation, 2025 · web · accessed 2026-10-22
  16. Unity Technologies · Material Variants · Unity Manual (Unity 6) · docs · accessed 2026-10-21

Also consulted

Last updated 2026-10-22