Skip to content

PBR Overview

MochiesCode edited this page Oct 1, 2026 · 8 revisions

Most of Mochie's shaders light surfaces with physically based rendering (PBR). Instead of painting how a surface should look under one particular light, you describe what it's made of: its color, whether it's metal, how rough it is, and its small-scale shape. The shader then works out how that material reacts to whatever lighting it's in, so the same material looks right in a sunny courtyard, a dim hallway, or a club full of colored lights.

This page covers the ideas behind PBR, the texture maps and workflows the shaders use, how to author and import textures for them, and how to fix the most common problems.

Which Shaders Use PBR

Shader PBR support
Standard Full PBR with the Metallic, Packed Metallic, and Specular workflows, detail maps, and height mapping.
Splat Mapping πŸ”’ Full PBR, with one packed map for each layer.
Uber PBR maps and reflections combined with toon-style shading. Metallic, Specular, Specular (Alpha Smoothness), and Packed Metallic workflows.
Glass Metallic, roughness, and occlusion, as separate maps or packed.
Particles Optional, in the Lighting section. Metallic and Packed Metallic workflows.
Water Roughness and metallic, as maps or values.
Taken πŸ”’ Metallic and roughness for its reflections.
LED Screen Roughness only, for the screen's reflections.

How PBR Works

The light leaving a surface is split into two parts:

  • Diffuse: Light that enters the surface, scatters around inside it, and comes back out in every direction, tinted by the surface's color. It's what you see on a matte wall, and it looks the same from every angle.
  • Specular: Light that bounces straight off the top of the surface without entering it. It shows up as reflections of the surroundings and as highlights from lights, and it shifts as you move your head.

A few rules keep this believable:

  • Energy conservation: A surface can't give off more light than it receives. The more light it reflects as specular, the less is left for diffuse. The shader handles this for you, so don't darken your textures to compensate.
  • Fresnel: Every surface reflects more at glancing angles. A lake barely reflects when you look straight down, but it turns into a mirror near the horizon, and even rough stone gets a faint sheen when viewed edge-on. The shader adds this automatically.
  • Microsurface: Up close, rough surfaces are covered in tiny bumps that scatter reflected light in many directions. Smooth surfaces give sharp, mirror-like reflections and small, bright highlights. Rough surfaces give blurry reflections and broad, dim highlights. The amount of light reflected is about the same either way; it's just spread out more.
  • Metals and non-metals: Non-metals (also called dielectrics: wood, stone, plastic, fabric, skin, paint, and rust) have a colored diffuse and weak, untinted reflections, only about 4% when viewed head-on. That's why red plastic has white highlights. Metals have no diffuse at all. They reflect nearly all of their light, and their reflections are tinted by the metal's color, so gold reflects gold.

Since the lighting comes from the scene, textures should describe the material and nothing else. Shadows, highlights, and reflections that are painted or photographed into a texture get doubled up by the shader's own lighting.

Texture Maps

Base Color

Also called albedo, or diffuse in older workflows. The color of the surface with no lighting in it: no shadows, highlights, reflections, or ambient occlusion.

  • On non-metals, it's the diffuse color.
  • On metals, it's the color of the reflections. Metals usually have bright base colors (see Reference Values).
  • Avoid pure black and pure white. Almost nothing is darker than charcoal or brighter than fresh snow. Values past that look flat in the dark and glow unnaturally in bright scenes.
  • Its alpha channel can hold transparency for blending modes that use it.

Metallic

Whether the surface is metal. White is metal, and black is non-metal.

  • Most of the map should be exactly black or white. Real materials are either metal or they aren't.
  • Gray is for transitions: the edge where paint meets bare metal, or a thin layer of dust or dirt on metal. Large gray areas don't look "a bit metallic". They look like dull plastic with an odd sheen.
  • Painted, rusted, or heavily oxidized metal isn't metal on its surface, so it's black in the metallic map.
  • At 0, the base color becomes the diffuse color and reflections stay untinted at about 4%. At 1, the diffuse goes black and the base color tints the reflections instead. Values in between blend the two.

Roughness

How rough the surface is at a microscopic level. White is rough, and black is smooth like a mirror. Some tools use smoothness instead, which is the same data inverted (see Roughness vs. Smoothness).

  • Roughness does more than any other map to make a material believable. Variation in it, like smudges, fingerprints, scratches, wear, and damp patches, makes a surface look real even when the base color is plain.
  • It affects reflections (rougher is blurrier) and highlights (rougher is broader and dimmer).

Normal Map

Fakes small details like bumps, grooves, scratches, and bevels by changing which way the surface faces for lighting, without adding geometry. The colors of this mostly blue-purple texture store those directions.

  • It doesn't change the silhouette. A normal mapped brick wall still has a perfectly flat edge.
  • Unity expects the OpenGL format. Maps made in the DirectX format, used by Unreal Engine, light bumps from the wrong side. See Normal Map Conventions.

Occlusion

Ambient occlusion (AO). Darkens cracks, crevices, and corners where surrounding geometry blocks light. White is open, and black is fully blocked.

  • It also darkens reflections in those areas, so crevices don't glow with reflected sky.
  • In Standard, it only darkens indirect light (lightmaps, light probes, and ambient light) and reflections. Realtime lights already cast their own shadows, so it doesn't affect them.
  • In Uber, the Direct Occlusion and Indirect Occlusion toggles in the Lighting section choose which light it affects. By default it only darkens direct light.
  • Keep occlusion out of the base color. Base color AO darkens crevices even where a light shines straight into them, and it doubles up with the occlusion map.

Height

A grayscale map of the surface's depth, used for parallax occlusion mapping. White is high, and black is low. The shader shifts the textures as you look around, so bricks and cobblestones appear to stick out of the surface. Texture libraries often call it displacement.

  • Like normal maps, it doesn't change the silhouette.
  • Use the full black-to-white range, and lower the height strength if the effect is too deep. A low-contrast map has fewer steps of depth to work with and can look layered.
  • It's expensive, since the height is read many times per pixel. Use it where it shows the most, like floors and walls seen up close, and use Standard's Height Falloff to fade it out at a distance.
  • It's available in Standard, Uber, and Splat Mapping πŸ”’. Standard doesn't support it with Triplanar sampling or in Standard Mobile.

Specular

Only used by the Specular workflows. The color and brightness of the reflections, used in place of a metallic map.

  • Non-metals use a dark, neutral gray. Metals use the metal's color, brightly.
  • The shader dims the base color by the specular brightness, so a bright specular color leaves little diffuse.

Emission

Not strictly part of PBR. Emission is light the surface gives off itself, like screens, lamps, and glowing runes. It's added on top of the lit result, so the scene's lighting doesn't affect it. The base color stays the color of the unlit surface underneath.

Detail Maps

Standard and Uber can layer a second set of maps, usually tiled much smaller, over the main ones. They add close-up detail like wood grain or pores in stone without needing huge textures. See Standard's Detail Textures and Uber's Detail Maps.

Workflows

A workflow is how the PBR maps are supplied to the shader. It's set with the Workflow dropdown in the inspector.

Shader Metallic Packed Metallic Specular
Standard, Standard Lite, Standard Mobile Yes Yes Yes
Uber Yes Yes Yes
Glass Yes Yes No
Particles Yes Yes No
Splat Mapping No Yes No

Metallic

Base color, metallic, and roughness, each in its own texture, along with optional occlusion and height maps. It's the default everywhere, the easiest to author, and matches what most tools and texture libraries produce.

Packed Metallic

The same data as Metallic, but metallic, roughness, occlusion, and optionally height share one texture, one map per channel. It's faster and uses less memory, so it's the best choice for finished materials. See Packed Maps.

Specular

Base color, a specular color map, and roughness or smoothness. It can make the same materials as Metallic, and mainly exists for textures made for a specular workflow, like materials made with Unity's Standard (Specular setup) shader. The specular map is a full color texture, so it uses more memory than a metallic map, and it's easier to create materials that couldn't exist in real life. Use Metallic for new work.

  • Standard: Specular. The Roughness/Smoothness Source takes roughness from a separate map or from the specular map's alpha.
  • Uber: Specular uses a separate smoothness map. Specular (Alpha Smoothness) reads smoothness from the specular map's alpha, like Unity's Standard (Specular setup) shader.

Roughness vs. Smoothness

Smoothness is inverted roughness: smoothness = 1 - roughness. Mochie's shaders work in roughness, like Unreal, Blender, Substance, and glTF. Unity's own shaders use smoothness. A smoothness map used as a roughness map looks inverted, shiny where it should be dull and dull where it should be shiny.

  • Standard: Turn on Smoothness Mode in the Shader Variant section. It treats every roughness map and value on the material as smoothness, including the packed and detail maps.
  • Uber: The Specular workflows use smoothness, and the Metallic and Packed Metallic workflows use roughness.
  • Glass, Particles, Water, LED Screen, and Splat Mapping πŸ”’: Roughness only. Invert smoothness maps in an image editor first (Image > Adjustments > Invert in Photoshop, Colors > Invert in GIMP).

Packed Maps

Channel packing puts up to four grayscale maps into the red, green, blue, and alpha channels of one texture. It has two benefits:

  • Faster: The shader reads one texture instead of up to four. Texture reads are among the most expensive parts of a shader, and Standard's Stochastic, Supersampled, and Triplanar sampling modes multiply every read by 3 to 4.
  • Smaller: One texture takes much less memory and download size than four, which helps with VRChat's upload size limits and players' VRAM.

Default Layout

Channel Map
Red Occlusion
Green Roughness
Blue Metallic
Alpha Height (optional)

This is the common ORM layout (occlusion, roughness, metallic) used by Unreal, glTF, Substance's packed export presets, and many texture libraries, so those textures work as they are. Height goes in the alpha channel. Turn on Packed Height in Standard, or Height Strength in Uber, to use it.

Channel selectors under the packed map let you read any other layout. Check them whenever a packed material looks wrong:

  • Uber's selectors default to metallic in red and occlusion in blue. Its Pack Textures button sets them for you, but if you assign an ORM texture yourself, set Metallic to Blue and Occlusion to Red.
  • Standard's packed detail map uses the same red, green, and blue layout. Its alpha channel isn't height. Coming in the v1.78 update: it's the alpha that the detail maps' Alpha blend mode blends with.

Other Common Layouts

Layout From Red Green Blue Alpha Setup in Standard
ORM Unreal, glTF, Substance Occlusion Roughness Metallic Works as is.
Mask Map Unity HDRP Metallic Occlusion Detail mask Smoothness Metallic Red, Occlusion Green, Roughness Alpha, and turn on Smoothness Mode.
Metallic Smoothness Unity Standard, URP Metallic Smoothness Metallic Red, Roughness Alpha, Smoothness Mode on, and Occlusion Strength at 0, since the map has no occlusion.

Swapping from Unity's Standard shader with Global Standard Settings doesn't carry over the smoothness stored in the metallic map's alpha, so set up the Metallic Smoothness layout by hand afterwards.

Making Packed Maps

  • Pack Textures button: In the Metallic workflow of Standard (primary and detail maps), Uber, Glass, and Particles. Assign the separate maps and click Pack Textures. It packs them into the layout above, saves the texture next to the material, assigns it, switches the workflow to Packed Metallic, and sets the channel selectors. See Texture Packer.
  • Export them packed: Substance 3D Painter and other tools can write packed maps directly. See Authoring Tools.
  • Image editors: In Photoshop, paste each grayscale map into its channel in the Channels panel, and save as a 32-bit TGA if it has an alpha channel. Photoshop's PNGs treat alpha as transparency and throw away the color underneath fully transparent areas. In GIMP, use Colors > Components > Compose with each map as a layer, and turn on Save color values from transparent pixels when exporting a PNG.

Normal Map Conventions

There are two normal map formats. The only difference is the direction of the green channel.

  • OpenGL (Y+): Used by Unity, Blender, glTF, and Substance 3D Painter by default. This is what Mochie's shaders expect.
  • DirectX (Y-): Used by Unreal Engine and 3ds Max.

A DirectX map in Unity lights bumps from the wrong side vertically, so raised details look sunken on some edges and raised on others. As a rule of thumb, an OpenGL map looks lit from above, and a DirectX map looks lit from below.

To fix a DirectX map:

  • Turn on Flip Green Channel in the texture's import settings.
  • Or invert the green channel in an image editor.
  • Or download the OpenGL version. Texture libraries often offer both, labeled GL and DX.

Texture Import Settings

Select a texture in the Project window to see its import settings in the Inspector.

  • Texture Type: Set normal maps to Normal map, or their lighting comes out wrong.
  • Compression: For packed maps without alpha, Normal Quality (DXT1 on PC) is half the size of High Quality (BC7 on PC), but it compresses the channels together, so detail from one map can bleed into the others as blocky artifacts. Switch to High Quality if you see them. With alpha, Normal Quality (DXT5) is the same size as High Quality, so use High Quality. Coming in the v1.78 update: the Texture Packer sets this for you.
  • Max Size: Unity imports textures at up to 2048 by default. Raise it to use a larger texture at full resolution.
  • Generate Mip Maps: Leave it on. Without mip maps, textures shimmer and sparkle at a distance.

Authoring Tools

Substance 3D Painter

The most widely used tool for texturing models. It works in the metallic/roughness workflow by default, which matches Mochie's shaders.

  • Leave Normal Map Format set to OpenGL in the project settings.
  • The simplest export is a custom output template (File > Export Textures > Output Templates) with:
    • Base Color: RGB from Base Color, and A from Opacity if the material uses transparency.
    • Normal: RGB from Normal OpenGL.
    • Packed: R from Mixed AO, G from Roughness, B from Metallic, and A from Height if you use height mapping.
    • Emission: RGB from Emissive, if used.
  • The built-in Unreal Engine (Packed) template already exports the ORM layout, but its normal map is DirectX. Switch it to Normal OpenGL, or turn on Flip Green Channel in Unity.
  • The built-in Unity templates export smoothness in Unity's own layouts. See Other Common Layouts for how to use them.

Substance 3D Designer and Sampler

Designer builds tileable materials procedurally, and Sampler turns photos into materials. Both export the same maps as Painter, and the same OpenGL and packing notes apply.

Blender

Blender uses roughness and OpenGL normal maps, the same as Mochie's shaders, so values and maps carry over directly. It's commonly used to bake normal, occlusion, and height maps from a high-poly model onto a low-poly one.

Texture Libraries

ambientCG and Poly Haven offer free (CC0) PBR materials.

  • Download the OpenGL normal map: NormalGL on ambientCG, and nor_gl on Poly Haven.
  • Their displacement maps work as height maps.
  • Poly Haven's arm maps are packed occlusion, roughness, and metallic, which matches the default layout.

Be careful with photo textures labeled "diffuse" from older sources. They often have lighting and shadows baked in.

Image Editors

Photoshop, GIMP, Krita, and Affinity Photo work for editing maps, inverting smoothness, and packing channels by hand (see Making Packed Maps). Materialize is a free tool that generates normal, height, roughness, and occlusion maps from a single photo.

Built-In Tools

  • Texture Packer: Packs separate maps into one packed map from the inspector.
  • Standard's Debug view: Displays one input on the material, like base color, roughness, metallic, occlusion, height, or normals, so you can check your textures in the scene. Debug View in Global Standard Settings switches every Standard material in the scene at once, which makes inconsistent textures easy to spot.
  • Uber's filters: The Metallic Filter and the other filters remap and adjust maps without editing the textures, with a grayscale preview.

Reference Values

These are starting points, not rules. Real materials vary, and a little variation looks more natural than perfectly uniform values.

Base Color

  • Non-metals: Roughly 30 to 240, in the 0–255 values shown by image editors. Charcoal is about 50, and fresh snow is about 240.
  • Metals: Bright, roughly 180 to 255. Metals are never dark in the base color; darkness in metal comes from what it reflects.
Metal Base Color (RGB)
Silver 252, 250, 245
Aluminum 245, 246, 246
Gold 255, 226, 155
Copper 250, 208, 192
Iron 196, 199, 199
Titanium 193, 186, 177

Roughness

Surface Roughness
Mirror, polished chrome, still water, glass 0 to 0.1
Car paint, glossy plastic, varnished wood 0.1 to 0.3
Plastic, rubber, brushed metal 0.3 to 0.6
Bare wood, leather 0.5 to 0.8
Concrete, stone, brick 0.7 to 0.95
Fabric, dirt, chalk 0.85 to 1

Lighting for PBR

PBR materials only look as good as the lighting around them.

  • Reflection probes: Metals and smooth surfaces get most of their look from reflections. Without a reflection probe, they reflect the skybox, which looks wrong indoors, like a bright sky reflected in a dark room. Place reflection probes and bake them, and turn on box projection for rooms. Standard, Splat Mapping πŸ”’, and Uber support box projection and blending between two probes. Bake the probes again whenever the lighting changes.
  • Metals need reflections: A fully metallic surface has no diffuse, so with reflections off or a black probe, it looks almost black. In Uber, reflections are off by default. While they're off, metallic doesn't darken the base color, so metal areas look like painted surfaces instead of metal. Turn on Reflections for metallic materials.
  • Avatars: Avatars reflect whatever probes the world has. Uber's Cubemap reflection mode, or its Fallback Cubemap for worlds without probes, keeps reflections consistent from world to world.
  • Highlights from baked lights: Realtime lights create specular highlights, but baked lights don't by default. In Standard, Bakery Specular Highlights (with a Bakery directional mode) and Light Volumes specular highlights add them back.
  • Specular occlusion: A reflection probe captures the scene from one point, so reflections can glow in places the probe doesn't account for, like under tables and in dark corners. Standard's Specular Occlusion darkens reflections in shadowed areas.
  • Specular antialiasing: Small, sharp highlights on dense normal maps flicker and sparkle as you move, especially in VR. Standard's Specular Antialiasing raises roughness where the normals change quickly to hide it.
  • Screen space reflections: Sharp, accurate reflections of what's on screen, for smooth surfaces like polished floors. They're expensive, so use them sparingly.

Troubleshooting

Problem Likely cause Fix
Shiny where it should be dull, and dull where it should be shiny A smoothness map used as roughness Turn on Smoothness Mode in Standard, or invert the map.
Bumps look lit from the wrong side A DirectX normal map Turn on Flip Green Channel in the import settings.
Normal map lighting looks strange or washed out Normal map not imported as one Set Texture Type to Normal map.
Metal looks black or dull No reflection probe, or reflections are off Bake reflection probes and turn reflections on.
Metal looks like plastic in Uber Reflections off in Uber Turn on Uber's Reflections.
Packed material looks wrong Channel selectors don't match the texture Check the channel selectors, especially in Uber. See Packed Maps.
Blocky artifacts in packed channels Compression mixing the channels together Set Compression to High Quality.
Double shadows, or dirty looking lit areas Lighting or occlusion baked into the base color Use a clean base color, and put occlusion in the occlusion map.
Everything looks too clean or perfect Uniform roughness Add variation to the roughness map: wear, smudges, and scratches.
Materials look different in every world Reflections rely on each world's probes Bake probes in your world. On avatars, use Uber's Cubemap or Fallback Cubemap.

πŸ”’ = Patrons only


Avatar Shaders

Uber
Uber X πŸ”’
Uber X (Outline) πŸ”’
Taken πŸ”’
Avatar Props πŸ”’

Environment Shaders

Standard
Water
Water (Tessellated) πŸ”’
Underwater Visuals
Glass
Splat Mapping πŸ”’
LED Screen

Special Effects Shaders

Particles
Particles X πŸ”’
Screen FX
Screen FX X πŸ”’
Corruption πŸ”’

Links

Clone this wiki locally