Lesson 4 of 6

PBR textures: maps, Material Maker, Substance and CC0 libraries

Texture Roblox meshes and parts with PBR maps. Learn colour, normal, roughness, metalness and emissive maps, SurfaceAppearance versus MaterialVariant, texel density, CC0 libraries and the tools studios use.

Tool lesson, about 75 minutes, 10 steps

By the end you can

  • Name the five PBR maps Roblox supports and what each one tells the light
  • Choose between a SurfaceAppearance and a MaterialVariant, and size textures by texel density
  • Find CC0 textures, check their licence, and pick a texturing tool for the job

Before this: From Blender to Roblox: FBX, the Importer and MeshParts

1One drone body, four pictures

Open Beacon Yard's drone template at m13-art-pass in a text editor. The body mesh carries a SurfaceAppearance with four slots, each waiting for an uploaded image:

<Item class="SurfaceAppearance" referent="BODYS">
<Properties>
<string name="Name">SurfaceAppearance</string>
<Content name="ColorMap"><url>{{PAINTED_METAL_COLOR_MAP_ID}}</url></Content>
<Content name="NormalMap"><url>{{PAINTED_METAL_NORMAL_MAP_ID}}</url></Content>
<Content name="RoughnessMap"><url>{{PAINTED_METAL_ROUGHNESS_MAP_ID}}</url></Content>
<Content name="MetalnessMap"><url>{{PAINTED_METAL_METALNESS_MAP_ID}}</url></Content>
Figure 1.1

One picture would only give the body a colour. Four pictures tell the light four different things about the surface, which is why painted metal can shine on a clean panel and look dull where paint has worn off.

Roblox Studio
Studio with the drone's SurfaceAppearance selected: the Explorer lists Drone, AssetWeld, SurfaceAppearance, Eye and the rotors, and the Properties panel shows ColorMapContent, MetalnessMapContent, NormalMapContent and RoughnessMapContent, each holding a texture id, over Beacon Yard at sunset.

Select a numbered pin, or a row below, to read what it marks.

Figure 1.2.

The drone body's SurfaceAppearance in Studio: four map slots in Properties, one per picture.

How many image maps does the drone body's SurfaceAppearance template ask for?

Answer

4 maps. Colour, normal, roughness and metalness. Roblox supports a fifth, the emissive mask, which the drone does not use.

Open this step in lesson mode · Link to this step · This confused me

2What each map tells the light

PBR (physically based rendering)PBR (physically based rendering)Shading a surface from several maps (colour, normal, roughness, metalness, emissive) so it looks right in any light.Think of it as a stack of transparent sheets, each telling the light one thing about the surface. stands for physically based rendering: several maps on one surface, so it looks right under any light. Roblox supports five1:

  • Colour (albedo): the surface colour with no lighting baked in. A shadow painted into the colour map looks wrong when the light moves.
  • Normal: fake bumps. Each pixel stores a direction; flat is [127, 127, 255]. Roblox reads only OpenGL tangent-space normal maps.
  • Roughness: 0 is a sharp mirror-like highlight, 1 is matte.
  • Metalness: almost always 0 (not metal) or 1 (metal).
  • Emissive mask: where the surface glows, for finer control than the Neon material.

The texture specifications ask for colour and normal as 24-bit RGB and the other three as 8-bit greyscale2.

How four PBR maps combine on one surfaceFour texture map boxes on the left (Colour RGB, Normal OpenGL RGB, Roughness 8-bit, Metalness 8-bit) feed into one SurfaceAppearance or MaterialVariant box on the right that renders the lit surface.Colour (albedo)24-bit RGB, unlitNormal24-bit OpenGL RGBRoughness8-bit grey (0 shiny)Metalness8-bit grey (0 or 1)Lit PBR surfaceSurfaceAppearance / Variant
Figure 2.1. Only the colour map is a picture; normal, roughness and metalness are data maps telling the renderer how light reacts.
Both sidesPBR texture maps is transparent sheets stacked on an overhead projector, each with one instruction for the light.
In the pictureIn Roblox
The colour sheetThe ColorMap (albedo), with no lighting baked in
The bumps sheetThe NormalMap
The shine and metal sheetsRoughnessMap and MetalnessMap, greyscale amounts

See the whole analogy cast

Think of a stack of transparent sheets on an overhead projector, each printed with one instruction for the light: this colour, these bumps, this shine, this much metal.

Think of it as Transparent sheets stacked on an overhead projector, each with one instruction for the light

Match each map to what it changes.

  1. Colour
  2. Normal
  3. Roughness
  4. Metalness
  5. Emissive mask
Answer

Colour: The base colour, with no lighting in it; Normal: Small bumps and dents, faked with per-pixel directions; Roughness: How sharp or spread the highlight is; Metalness: Whether the surface reflects like a metal; Emissive mask: Which areas glow. Colour is the only map you see as a picture. The rest are data: directions, and greyscale amounts of roughness, metalness and glow.

Open this step in lesson mode · Link to this step · This confused me

3Two homes for maps: SurfaceAppearance and MaterialVariant

Roblox has two objects that hold PBR maps. A SurfaceAppearance belongs to one MeshPart and follows that mesh's flat 2D texture layout, called a UV mapUV mapA flat layout of a 3D model's surface, so a 2D image can be painted onto it.Think of it as a gift-wrap pattern: the model's skin cut open and laid flat., so the picture can know where the rim is. A MaterialVariant lives in MaterialService and is a tileable material for parts and terrain: it repeats every StudsPerTile studs and keeps its base material's physical properties3.

Beacon Yard uses both. The drone's meshes carry SurfaceAppearances in their template, and the walkway, floor, shop and walls use variants. Each variant is a small template that gen-assets.mjs fills with your texture ids and writes into MaterialService. This is the walkway's:

<token name="BaseMaterial">1088</token>
<Content name="ColorMap"><url>{{METAL_PLATE_COLOR_MAP_ID}}</url></Content>
<Content name="NormalMap"><url>{{METAL_PLATE_NORMAL_MAP_ID}}</url></Content>
<Content name="RoughnessMap"><url>{{METAL_PLATE_ROUGHNESS_MAP_ID}}</url></Content>
<Content name="MetalnessMap"><url>{{METAL_PLATE_METALNESS_MAP_ID}}</url></Content>
<float name="StudsPerTile">8</float>
Figure 3.1

In Studio the same variant shows up in the Material Manager (Window, 3D, Material), where you can read these keys without opening the file:

Roblox Studio
The Roblox Studio Material Manager with the Metal category open and the beacon_yard_plate variant selected. The inspector lists Base Material Metal, then the Texture Maps for Color, Metalness, Normal and Roughness, each with a small preview and a texture id, an empty Emissive slot, and Tiling with Studs Per Tile 8 and Pattern Regular.

Select a numbered pin, or a row below, to read what it marks.

Figure 3.2.

The variant in the Material Manager. The Overrides, Terrain Details and Physics sections are collapsed.

You want rust on all of the yard's walls, repeating every 8 studs. Which object holds the maps?

  1. A MaterialVariant with a metal base material and StudsPerTile 8
  2. A SurfaceAppearance on each wall part
  3. A Decal on each face
  4. A TextureID on the Workspace
Answer

A MaterialVariant with a metal base material and StudsPerTile 8. Variants are for repeating materials on parts and terrain. SurfaceAppearance needs a MeshPart and its UVs, and is for one-off surfaces like the coin.

Open this step in lesson mode · Link to this step · This confused me

4How big should the image be?

Texel density is how many texture pixels cover one stud. Keep it similar across the scene, or a sharp crate sits next to a blurry wall. Roblox's own numbers make a good target: built-in part materials show 1024 by 1024 pixels on an 8-stud face, which is 128 pixels per stud, and terrain shows 512 across 8 studs, 64 per stud2.

For SurfaceAppearances the same page gives a budget: about 256 by 256 for every 2 by 2 by 2 stud space, with 1024 by 1024 as the top of the PBR budget table. Roblox may also downsample textures when many are on screen. Beacon Yard's walkway variant, beacon_yard_plate, tiles every 8 studs, so a 1024-pixel map there matches the built-in materials.

Density, not size

A 2048-pixel map is not "better" than a 512-pixel one. It is only right if the surface it covers is four times as wide. Pick the pixels per stud first, then work out the image size.

beacon_yard_plate repeats every 8 studs (StudsPerTile 8). Its colour map is the 1K download, 1024 pixels wide. How many pixels cover one stud?

Answer

128 px per stud. 1024 / 8 = 128 pixels per stud, the same density as Roblox's built-in part materials.

Open this step in lesson mode · Link to this step · This confused me

5Free textures you may actually ship

You do not have to paint every surface. Two large libraries publish PBR texture sets under CC0, which means you may use them for anything, commercial included, with no credit required. Poly Haven says all of its assets are CC04. ambientCG says the same for its downloadable files and preview renders5.

Beacon Yard uses ambientCG. From m13-art-pass its four texture sets, metal plate, concrete, painted metal and rust, are committed in the repo as 1K downloads, with a credits file that records each source:

| Folder | ambientCG asset | Source | Used for | Maps |
|---|---|---|---|---|
| `metal_plate/` | Metal Plates 014 | <https://ambientcg.com/view?id=MetalPlates014> | Walkway variant, drone rotors, wrench, beacon | Color, NormalGL, Roughness, Metalness |
| `concrete/` | Concrete 030 | <https://ambientcg.com/view?id=Concrete030> | Shop and floor variants | Color, NormalGL, Roughness |
| `painted_metal/` | Painted Metal 016 | <https://ambientcg.com/view?id=PaintedMetal016> | Drone body | Color, NormalGL, Roughness, Metalness |
| `rust/` | Metal 041 B | <https://ambientcg.com/view?id=Metal041B> | Wall variant | Color, NormalGL, Roughness, Metalness |
Figure 5.1

Two things to copy. The file names end in NormalGL: Roblox reads only OpenGL normal maps, and the NormalDX file in the same download has a flipped green channel. And the credits file exists even though CC0 asks for nothing, so a reviewer can check the licence later.

Which of these does CC0 let you do with an ambientCG texture?

  1. Use it in a game you sell
  2. Ship it without crediting anyone
  3. Keep it inside Beacon Yard, whose art is otherwise CC BY 4.0
  4. Claim you painted it
Answer

Use it in a game you sell; Ship it without crediting anyone; Keep it inside Beacon Yard, whose art is otherwise CC BY 4.0. CC0 allows any use without credit, so it can sit inside a CC BY project (the repo's credits file notes that these files stay CC0). Claiming authorship is still dishonest.

Open this step in lesson mode · Link to this step · This confused me

6The tools that make maps

When a library does not have it, you author it. These are the tools you will meet:

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Adobe Substance 3D PainterPaint PBR maps straight onto a mesh with layers, masks and smart materials.The industry standard for hero props and characters in game studios.Paid: Steam lists it from 24.99 US dollars a month, or 199.99 US dollars once. Proprietary project files.
Material MakerFree, open-source node-graph tool for procedural tileable materials, with an experimental painter.Tileable materials for MaterialVariants on a zero budget.Smaller community; painting is less mature than Substance.
Blender Texture Paint and bakesPaint on the mesh and bake normal maps from a detailed model, inside Blender.You already model in Blender and need simple painted or baked maps.Layers and masks are basic compared with dedicated painters.
ArmorPaintStand-alone PBR texture painter with node materials and GPU baking.A Substance-like painter without a subscription.Ready-made builds cost 19 US dollars; the source is zlib-licensed if you build it yourself.
CC0 librariesPoly Haven and ambientCG texture sets.Floors, walls, metals and other common surfaces.Everyone else can use the same textures; realistic photo scans may not match a stylised game.

Beacon Yard needs a tileable rusted-steel material for the walkway, and the course has no budget. Which tool fits best?

  1. Material Maker
  2. Substance 3D Painter
  3. Photoshop
  4. A hand-painted Decal on every face
Answer

Material Maker. Material Maker builds tileable PBR sets from nodes and costs nothing. Substance Painter paints on one mesh and is paid; Photoshop is paid and 2D only; a Decal pastes one flat image per face with no normal, roughness or metalness maps.

Open this step in lesson mode · Link to this step · This confused me

7Where the overlay picture breaks

Both sidesRemember: PBR texture maps is transparent sheets stacked on an overhead projector, each with one instruction for the light.

Stacked sheets change what you see. Decide what they can never change before you open the breakdown.

Where does it break?“Transparent sheets stacked on an overhead projector, each with one instruction for the light” is a good picture of pbr texture maps. Where does it stop being true?

It breaks here. Sheets on a projector can make a flat wall look carved, and so can a normal map, but nothing changes the object's outline, collision or mass: look at the silhouette against the sky and it is smooth.

The true model. PBR maps feed the lighting calculation per pixel. Geometry, triangle count, physics shape and mass come only from the mesh and the part.

You put a strong bumpy normal map on the coin. Look at the coin's outline against the sky. What do you see?

  1. A perfectly smooth outline: normal maps change shading, not geometry
  2. A bumpy outline matching the map
  3. A thicker coin
  4. A coin with more triangles
Answer

A perfectly smooth outline: normal maps change shading, not geometry. Maps change how light shades the surface. The silhouette, triangle count, collision and mass stay exactly as the mesh and part define them.

Open this step in lesson mode · Link to this step · This confused me

8Build it: a fifth variant from a CC0 set

Retiring the analogy

You no longer need “transparent sheets stacked on an overhead projector, each with one instruction for the light”. PBR maps feed the lighting calculation per pixel. Geometry, triangle count, physics shape and mass come only from the mesh and the part.

Build along

m13-art-pass

  • assets/textures/corrugated/
  • assets/textures/CREDITS.md
  • assets/templates/materials/beacon_yard_corrugated.rbxmx
  • src/shared/Ids.luau
  • src/server/WorldLook.luau
  • src/server/MapBuilder.luau
  1. Download CorrugatedSteel005 from ambientCG as the 1K JPG zip. Keep only the maps Roblox reads.

    You should see Four image files, Color, NormalGL, Roughness and Metalness, sit in assets/textures/corrugated/ and no NormalDX file does.

  2. Add the row to assets/textures/CREDITS.md.

    You should see CREDITS.md has a new row with the folder, the asset name, its ambientCG link, what it is used for and the maps you kept.

  3. Add the four keys to both Ids files at 0, and run node scripts/check-ids.mjs: it still passes.

    You should see Ids.luau and Ids.local.example.luau list CORRUGATED_COLOR_MAP_ID, _NORMAL_, _ROUGHNESS_ and _METALNESS_, all 0.

  4. Copy assets/templates/materials/beacon_yard_plate.rbxmx to beacon_yard_corrugated.rbxmx and change the name, keys and base material (Enum.Material.CorrodedMetal is token 1040).

    You should see beacon_yard_corrugated.rbxmx holds your four keys, BaseMaterial 1040 (CorrodedMetal) and a StudsPerTile you chose.

  5. Import the four images with Studio's Asset Manager, put their ids in your git-ignored Ids.local.luau, and run node scripts/gen-assets.mjs.

    You should see gen-assets prints: material beacon_yard_corrugated -> assets/materials/beacon_yard_corrugated.rbxmx.

  6. Wire the variant into the yard by code. In src/server/WorldLook.luau, add "corrugated" to the Slot type and a corrugated entry to SLOTS: material = Enum.Material.CorrodedMetal and variant = "beacon_yard_corrugated". Then in src/server/MapBuilder.luau, call WorldLook.apply(scrapStack, "corrugated") for a scrap stack such as ScrapStack2. apply sets the part's material to the slot's base material, so pick a part that is already CorrodedMetal. MapBuilder rebuilds Workspace.Yard every time Play starts, so a part you place by hand is deleted and never counts. Only code in the build does.

    You should see WorldLook.luau has a corrugated slot (CorrodedMetal and beacon_yard_corrugated), and MapBuilder applies the corrugated slot to ScrapStack2.

  7. Run rojo build -o beacon-yard.rbxlx, reopen the built place and press Play. A running script cannot set a variant's base material, so the variant has to be in the place file.

    You should see After a rebuild and Play, MaterialService lists the variant, and ScrapStack2 under Workspace.Yard has MaterialVariant beacon_yard_corrugated.

Open this step in lesson mode · Link to this step · This confused me

9Challenges

Level 1, Apprentice

Challenge

Read assets/templates/Drone.rbxmx and assets/textures/CREDITS.md, and say which set paints which part.

Start from
The game at milestone m13 (download)

Done means

  • You named the texture set that paints the drone body and the set that paints its rotors
  • You can say which ambientCG page each one came from

Hints

  1. Search assets/templates/Drone.rbxmx for the _MAP_ID keys.
  2. assets/textures/CREDITS.md maps each key prefix to an ambientCG asset.

A texture pack ships a DirectX normal map only. What do you do before using it in Roblox?

  1. Invert its green channel to make it OpenGL
  2. Nothing; Roblox reads both
  3. Convert it to greyscale
  4. Use it as the roughness map
Answer

Invert its green channel to make it OpenGL. OpenGL and DirectX normal maps differ in the green channel's direction. Flipping it converts one to the other.

Level 2, Builder

Challenge

Pick the texture size for a crate the yard might get, and justify it with numbers.

Start from
The game at milestone m13 (download)

Done means

  • You chose a map size for a new 4 by 4 by 4 stud crate using Roblox's PBR budget
  • You can say its texel density in pixels per stud

Hints

  1. 256 pixels per 2 by 2 by 2 studs is the guideline.
  2. A 4-stud crate is twice that size on each side.

Level 3, Professional

Challenge

Ship the fifth variant and use it on the yard. The check (challenges/textures-pbr.luau) lives in the game repo at m14-ship, which includes the m13-art-pass art pipeline, and the steps are in challenges/solutions/textures-pbr.md. The game's own written steps for the same job are challenges/solutions/pbr-textures.md.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("textures-pbr", "textures-pbr-variant") in the server command bar. Copy the pass code from Output.

Done means

  • MaterialService contains a MaterialVariant named beacon_yard_corrugated
  • Its BaseMaterial is CorrodedMetal and its StudsPerTile is greater than 0
  • At least one part in Workspace.Yard uses it as its MaterialVariant, set by code (WorldLook slot and MapBuilder), not placed by hand
  • The test prints TEST PASS for variant_present, variant_base and variant_applied

Hints

  1. Follow the build-along through the WorldLook slot and the MapBuilder call. MapBuilder rebuilds Workspace.Yard at Play, so a hand-placed part is gone before the test runs.
  2. The test reads names and properties only. It cannot read the map ids, which need plugin security.
  3. Run it from the server command bar during Play, as challenges/README.md shows.

Open this step in lesson mode · Link to this step · This confused me

10Recap

Recap

  1. Roblox's PBR maps are colour, normal (OpenGL), roughness, metalness and an emissive mask; they change shading only.
  2. SurfaceAppearance paints one MeshPart through its UVs; MaterialVariant is a tileable material for parts and terrain, sized by StudsPerTile.
  3. Aim for a steady texel density (built-in parts are 128 px per stud), and use CC0 libraries or Material Maker before paying for Substance.

PBR texture maps is transparent sheets stacked on an overhead projector, each with one instruction for the light, until sheets on a projector can make a flat wall look carved, and so can a normal map, but nothing changes the object's outline, collision or mass: look at the silhouette against the sky and it is smooth.

Next Other tools studios use: Maya, ZBrush, Blockbench, Substance, Marmoset

Open this step in lesson mode · Link to this step · This confused me