Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 38 ยท Materials and Lighting

Materials and PBR Basics

Learn how Unreal Engine materials work. Physically based rendering inputs, the Material Editor, texture samples, math nodes and a simple shading model explained.

A mesh gives an object its shape; a material gives it its look. In Unreal Engine, a material is a small shader program built visually in the Material Editor as a graph of nodes. The graph's final node, the Main Material Node (or Material Attributes), has inputs such as Base Color, Metallic, Roughness, Normal and Emissive Color. The renderer reads those values per pixel and combines them with lights.

The Unreal Editor is not available on this site, so this lesson describes workflows in words. The Python stand-ins reproduce the arithmetic that nodes perform, so you can build intuition for the numbers.

Physically based rendering in one page

Unreal uses physically based rendering (PBR). Instead of fiddly "shininess" and "ambient" sliders, you describe the surface with a few properties that behave consistently under any lighting:

  • Base Color: the albedo, the color of the surface when lit evenly. For metals it is the reflection tint. Keep it out of pure black (about 0.02 minimum) and pure white (about 0.9 maximum) for realism.
  • Metallic: 0 for non-metals (wood, plastic, skin, stone), 1 for bare metals. Values in between are only meant for transitions such as rust edges or dirt on metal. Real surfaces are almost always near 0 or 1.
  • Roughness: 0 is a perfect mirror, 1 is fully matte. It controls how blurry reflections and highlights are.
  • Specular: for non-metals, a small control (default 0.5, about 4 percent reflectance). Rarely changed.
  • Normal: a tangent-space map that fakes small surface detail without extra triangles.
  • Ambient Occlusion: darkens crevices where ambient light can't reach.
  • Emissive Color: light the surface gives off. Values above 1 are allowed in HDR and can cause bloom.
  • Opacity / Opacity Mask: used for translucent or cut-out materials, selected with the Blend Mode.

PBR inputs

Base Color Albedo, no lighting
Metallic 0 or 1
Roughness Sharp to blurry
Normal Fake bumps

Four inputs cover most surfaces

1 / 2

Your first material

In the Content Browser, right-click and choose Material, name it M_Brick, and double-click to open the Material Editor. The usual steps are:

  1. Right-click in the graph and search for TextureSample, or drag a texture asset in from the Content Browser.
  2. Connect its RGB output to Base Color.
  3. Add a second TextureSample for the roughness map and connect a single channel (R, G or B) to Roughness.
  4. Add a third for the normal map. Normal maps must be imported with the Normal Map compression setting, which the editor usually detects automatically.
  5. Press Apply, then Save. Drag the material onto a mesh in the viewport.

A common optimization is a packed ORM texture: Occlusion in the red channel, Roughness in green and Metallic in blue. One sample returns three values, and the texture uses linear (not sRGB) color, which you set in the texture's asset settings.

Nodes that do the arithmetic

The graph is a pipeline of small operations, executed for every pixel:

Node What it does
Constant, Constant3Vector A fixed number or color
Multiply, Add, Lerp Arithmetic; Lerp blends A and B by Alpha
TextureCoordinate UVs; set tiling by multiplying
Power, Clamp, OneMinus Contrast and range control
Fresnel Brighter at grazing angles
Time, Panner Animation
Scalar/Vector Parameter Values you can change in material instances
Python Stand-in: Lerp, Multiply and OneMinus on a color

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Lerp is the workhorse for blending materials: a mask texture or a vertex color drives Alpha, so dirt, moss or snow appear only where the mask is bright.

How lighting uses the inputs

The renderer evaluates a shading model (Default Lit, by default) for each pixel. Here is a drastically simplified version, only to show how the inputs shape the result: a diffuse part scaled by (1 - Metallic) and a specular part tinted by Base Color for metals.

Python Stand-in: toy PBR shading

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real Unreal shading uses a more refined model (GGX specular, Smith geometry term, Schlick Fresnel), but the structure is the same: metals have no diffuse and tinted specular, and roughness controls highlight width.

Blend modes and shading models

The Details panel of a material has two key settings:

  • Blend Mode: Opaque (default, cheapest), Masked (hard cut-outs like leaves, with an Opacity Mask clip value), Translucent (glass, smoke, more expensive and sorted), Additive and Modulate (special effects).
  • Shading Model: Default Lit, Unlit, Subsurface, Two Sided Foliage, Clear Coat (car paint), Hair, Eye and others. Pick the cheapest that fits.

Use the Stats window (Window > Stats in the material editor or the toolbar's Stats toggle) to see the instruction count. Cheaper materials draw faster; masked and translucent ones cost more per pixel.

Common mistakes

  • sRGB on data textures. Roughness, metallic, normal and ORM textures must have sRGB turned off, or values come out wrong.
  • Metallic gradients everywhere. Mid values look like nothing in nature; keep it binary and use masks.
  • Translucent everything. It is costly and sorts badly; use Masked when a hard edge is acceptable.
  • Huge unique textures per prop. Prefer tiling textures plus masks.

For making many variations without recompiling shaders, see Material instances and parameters.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What should Metallic values be for most real-world surfaces?

    Surfaces are mostly non-metal (0) or bare metal (1); in-between values are for transitions like rust or dirt.
  2. 2. In a packed ORM texture, which channel usually holds Roughness?

    ORM packs Occlusion in red, Roughness in green and Metallic in blue.
  3. 3. Which Blend Mode is best for hard-edged leaf cut-outs?

    Masked uses an Opacity Mask clip, cheaper and better behaved than translucency for hard edges.
  4. 4. What does the Lerp node do?

    Lerp is linear interpolation: A when Alpha is 0, B when Alpha is 1.

Summary

  • A material is a node graph feeding Base Color, Metallic, Roughness, Normal, Emissive and more.
  • PBR inputs describe the surface; the renderer combines them with lights.
  • Data textures (roughness, normal, ORM) must not be sRGB.
  • Use Lerp with masks to blend, and choose the cheapest blend mode and shading model that fit.

Next: Material Instances and Parameters