An HDR image, with and without PMREM
Left: the raw HDR used as envMap, with no mapping set: a black ball, and no warning. Right: after PMREMGenerator: the studio, with its two round light boxes. HDR file: Poly Haven, CC0.
Shiny metal shows its surroundings, not the light. An environment map is a picture of the surroundings, turned by PMREMGenerator into light and reflections. Without one, chrome is black.
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 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write the lines that load /data/3d/hdr/studio_small_08_1k.hdr and make it the scene's environment, falling back to RoomEnvironment if it fails.
How do you make the sky behind the bike blurred but keep the reflections sharp?
Explain it without notes
Why is a chrome ball black in a scene that has several lights?
What does PMREMGenerator do, and what happens if you skip it?
Console
Nothing logged yet.Expected console output
image: 1024 x 512 | type: 1016 (HalfFloatType is 1016) | mapping: 300
prepared map: true | mapping: 306 (CubeUVReflectionMapping is 306)