Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 5.3 — PBR: Metalness and Roughness
3D Web · Example 1 of 2

Metal with and without an environment

Only an AmbientLight lights this scene. The environment comes from RoomEnvironment, built into three.js, so nothing is downloaded.

Physically based rendering describes a surface with two numbers, metalness and roughness, and lights it with rules from real optics. You learn what each number does, why metal needs something to reflect, and what clearcoat adds for car-style paint.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Build a chrome bell: a sphere that looks like polished metal using the course's studio image. Write the setup.

02

Make the paint ball look like car paint with a lacquer that is sharper than the paint under it.

Explain it without notes

01

Why is a metal ball black under an AmbientLight, and what are two ways to fix it?

02

What do metalness and roughness each control, and why does roughness not make a surface darker overall?

Metal with and without an environment
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

no environment   metalness 0: 180,73,28   metalness 0.5: 132,52,17   metalness 1: 0,0,0
with environment metalness 0: 255,169,99   metalness 0.5: 255,200,115   metalness 1: 255,192,85