Why environment light matters so much
Metal, paint and glass mostly show what they reflect. Without an environment a chrome part looks black or flat. With a suitable environment, highlights, reflections and gradients appear, and these are what make the material recognisable. For its extended material, the three.js documentation explicitly recommends always setting an environment map [3].
HDRI
An HDRI (high dynamic range image) stores brightness far beyond what an ordinary photo captures, such as the sun next to a shadow. Wrapped around the scene, it supplies light from every direction.
How the browser turns it into light
For rough and smooth surfaces to respond correctly, the environment is pre-filtered. In three.js the PMREMGenerator creates an environment map whose levels are pre-computed from mirror-smooth to fully rough [1]. Filament classes such image-based lights as indirect lighting [2].
Studio rather than landscape
For products a neutral studio environment is often better than a landscape: it does not tint the product and does not distract. The two examples below do not load an HDRI photo; they build a simple studio environment in the browser and filter it with PMREM, which saves downloading a large image. They are the spiral stair configurator and the planetary gearhead (fictional products).
What to watch
- The brightness and colour of the environment change how your product colours look. Check colours against real samples.
- Large HDRI files cost loading time. A small or generated environment is often enough for reflections.
- Shadows on the floor usually come from an extra light or from baking, not from the environment alone.
The 3D product viewer page shows how lighting fits into a viewer project.