Page 12: Fancy Shading

Spring 2026 Sample Solution

Three.js provides two different physically based lighting models. They provide a wider range of effects, and their parameters more closely match the actual properties of materials. Here is an example of a MeshPhysicalMaterial where you can experiment with the parameters.

A big advantage of the physical materials is that they allow for image-based lighting. Basically, rather than making individual light sources, we can give a picture of the environment and use that as a light source. We will come back to this. But for now, you can experiment with what it does.

We won’t discuss the physical lighting models much. You can use them without understanding the details: the intuitions from Phong lighting apply.

Before we can discuss image-based lighting, we need to talk about how we use images more generally. This brings us to textures.

But first, now might be a good time to make a checkpoint and write out the .json for your localstore.

Next: Page  13 - Texture Basics