This page sits under my guide to 3D product configurators, which covers rules, 3D assets, performance and hand-off.
HDRI lighting uses a high dynamic range image of an environment to light a 3D scene. The image supplies light and reflections from every direction. Glossy and metal surfaces benefit most, because they show what they reflect.
Discuss your product rangeTry the demos
What an HDRI is
HDRI stands for high dynamic range image. Unlike a normal photo, it stores very bright and very dark values with real detail behind each one. A bright window or a lamp keeps its true strength, so it can light a scene accurately. Most HDRIs are panoramas that wrap around the object, which is why they work so well as a surrounding light source. A studio capture or a carefully made synthetic environment can serve equally well, provided the light looks plausible.
In a 3D engine, the HDRI becomes an environment map. The engine treats each pixel as light arriving from one direction. Together, those pixels act like many soft lights surrounding the product, and that is why the result looks natural. The product sits inside the environment rather than under a single lamp.
- Capture or choose an HDRI
- Convert with PMREMGenerator
- Assign as scene environment
- Metal and gloss reflect it
How three.js uses an environment map
In three.js, the PMREMGenerator converts the HDRI into a prefiltered, mipmapped map. The map stores blurred versions for different roughness levels. A rough surface samples a soft reflection, while a polished surface samples a sharp one. The prefiltering uses GGX importance sampling, which matches the model that physically based materials use, so the reflections behave consistently. That consistency matters when the shopper switches finishes, because each option should look as if the same environment is in use.
The steps are short and easy to repeat. You create a generator from the renderer, convert the equirectangular texture, then assign the result to scene.environment. Finally you can dispose of the generator to free its internal resources. The documentation says the ideal input size is 1k (1024 x 512), which matches its 256 x 256 cubemap output.
Why it matters for product configurators
Product shots depend heavily on reflections. A metal finish looks flat under a single directional light, because nothing around it gives it character. With an HDRI, the metal picks up the surroundings, which makes the finish read as real. Shoppers judge quality by cues like these, so the lighting matters a great deal to the sale.
For example, a watch case in steel or gold needs something to reflect. A plain grey background gives a dull result. A studio-style HDRI gives highlights that run along the curves of the case, and those highlights move as the shopper orbits the watch.
- Metal and glossy finishes gain the most from a believable environment.
- One HDRI can light the whole product without a rig of many separate lights.
- Switching the HDRI can change the mood of a product quickly and cheaply.
These benefits suit a configurator well. The finish options change the surface, while the environment stays the same for every option the shopper picks. The 3D product configurator page explains how lighting fits into the wider viewer.
How I choose and prepare an HDRI
I choose the HDRI for the product, not for visual drama. A soft studio light suits a kitchen appliance, while a warm interior suits a lamp or a sofa. I check that the highlights fall where the product’s form needs them, because that decides how the object reads from every angle the shopper might choose.
I keep the resolution modest. A large file slows the first load, and the three.js PMREMGenerator documentation names 1k (1024 x 512) as its ideal input size, a sensible starting point for most products. I convert the file once, then reuse the environment for every option change, so the cost is paid only at load time.
I also check the background. An HDRI can be shown behind the product, but a busy photo may distract the shopper from the item. I often use a plain background and keep the HDRI for light and reflection only. HDRI lighting works best with physically based materials, which my guide to PBR explains in more detail. For whole projects, my product configurator service covers the lighting setup alongside the rest of the viewer.
Environment maps
An environment map is the image of the surroundings that a 3D scene uses for lighting and reflections, and an HDRI is the usual source. Shiny surfaces reflect it, and rough surfaces pick up its soft light. The source should describe a believable space: a map that looks unnatural will light a product unnaturally, even when the material settings are correct.
In three.js the map is set through the scene.environment property. The Scene documentation says it “Sets the environment map for all physical materials in the scene”, and the default is null, so nothing is reflected until you set a map on purpose. Because it reaches every physical material, it also lights parts you did not expect. I check the model on a plain setup in the GLB viewer first, then check each option in the full page layout before release.
Why matt finishes need it too
A chrome watch case with no environment map looks dark and flat, because it has nothing to reflect. Fabric and matt plastic need the map as well: they pick up gentle, diffuse light from it, which keeps them from looking like plain colour. The Khronos PBR guide explains that roughness controls how sharp or blurred reflections look; the environment supplies the content those reflections show.
So the PBR material values and the environment work as a pair. Good material values with no map can look wrong, and a good map cannot fix a poor material. I often test a product with two maps, one bright and one soft, side by side. The difference shows quickly which map keeps the finish honest, and the evidence on screen is easy to explain to a client.
How I set one up
- One neutral studio map for the whole configurator, unchanged between finishes. A brushed steel option and a gloss black option should respond to the same light, so the shopper judges the material, not the lighting.
- Map resolution matched to the viewer size, because oversized maps slow the first load.
- Brightness set separately with scene.environmentIntensity, so it can be tuned without re-exporting the model.
- Rotation with scene.environmentRotation, only when a product needs a fixed highlight position.
Keeping these settings in code means the look can change without touching the 3D files, which saves time when a client asks for a different mood.
Pitfalls
- A map that is too bright washes out colours, and strong sun spots put hard highlights on a product that should look soft. Both show most on glossy finishes. A bright outdoor photo rarely suits an indoor product.
- scene.background is separate. Setting the environment does not draw a backdrop; you set each one on its own, and can use the same image for both.
- The map does not ground an object on a surface. Contact shadows need a separate method, such as a baked or screen-space shadow.
Tone mapping
A 3D scene can hold light values far brighter than a screen can show. A screen tops out at full white, while a lit metal edge or a bright window in the environment can be many times brighter. Tone mapping is the step that squeezes those values into the range the screen can display. Without it, bright areas turn flat white, shadows lose their detail and small surface changes disappear, most obviously on glossy and metal finishes.
It changes colour, not just brightness
Different tone mapping curves also shift hue and saturation. A red chair can look orange or dull after the wrong curve, which is a real problem for a shopper choosing a colour. Highly saturated colours are the hardest to hold, and a glossy lacquer shows shifts more strongly than a matt fabric, so the two may need different checks.
Khronos designed its PBR Neutral tone mapper for this reason. The Khronos glTF PBR guide says it “enables faithful reproduction of a product’s base color, hue and saturation”. That makes it a sensible starting point for product work, though it is still worth testing against physical swatches under daylight before you commit to it for a whole catalogue.
Exposure is a separate control. It is a brightness multiplier that scales the colour before the tone mapping curve is applied; the three.js ToneMappingNode documentation shows exposure as one of its inputs. Neither setting touches the model: tone mapping is applied by the viewer at render time and does not change the GLB file.
What I check when I set it up
- One tone mapping setting for the whole viewer, kept fixed. Changing it per option makes the same fabric shift colour as the shopper switches, which undermines trust in the colour.
- The rendered colour compared with a physical swatch under daylight, not under a warm office lamp. Material swatches covers matching samples.
- The lightest and darkest finishes, such as white and black, tested in the same scene.
- Exposure kept as one deliberate control, never raised to hide poor lighting, which crushes shadow detail.
- Colour judged on more than one uncalibrated monitor, and against the page background the product will sit on. A bright background can make a product look dim by contrast; a dark one can make it look richer.
I keep a short written record of the chosen setting and the reason for it, so the next developer knows what was tested when a finish changes later. Tone mapping cannot rescue a badly lit model: it only shapes the light you already have, so set up the materials and lighting first. And do not assume a setting that suits one product family, such as soft textiles, will suit another, such as polished metal.
Common mistakes and limits
- Skipping the prefiltering step, or setting the wrong mapping on the texture, so reflections look wrong on rough and smooth surfaces.
- Using a huge HDRI, which slows the first load on phones and tablets.
- Expecting sharp shadows from the environment alone, which it does not produce.
- Showing an HDRI background that clashes with the product’s colours.
An environment map does not cast directional shadows by itself. If a product needs crisp shadows, add a directional light and tune it against the environment so the two agree. Dark surfaces can still look flat when the environment lacks contrast, so I test each finish before I sign off a scene.
Colour handling matters too. Load the HDR file with a loader built for HDR files, not as a standard image. Otherwise its brightness can be wrong, and the whole scene will look off in a way that is hard to diagnose.
Related terms
- Baked lighting: Baked lighting calculates light ahead of time and stores the result in a texture, called a lightmap.
- Tone mapping: Tone mapping converts the wide range of light values in a 3D scene into the narrower range a screen can show.
- Environment map: An environment map is an image of the surroundings that a 3D scene uses for lighting and reflections.
- 3D asset pipeline: A 3D asset pipeline is the set of steps that turns source files into models a web viewer can load.
- Digital twin: In a product configurator, a digital twin usually means a 3D model that matches a real product's shape, materials and options.
- Configurator embed: A configurator embed is how a 3D configurator appears inside another website.
- Material swatch: A material swatch is a sample of a finish, such as fabric, leather or metal, shown as a choice in a configurator.
- Scene Viewer: Scene Viewer is Google's viewer for 3D and augmented reality (AR) models on Android.
- WebXR: WebXR is a web standard for augmented reality (AR) and virtual reality (VR) in the browser, published by the W3C.
- WebGL: WebGL is a web standard that lets a browser draw 3D graphics on a canvas, using the device's graphics chip.
Browse all the definitions in the 3D commerce glossary.
Common questions
What is the difference between an HDRI and a normal image?
An HDRI keeps a far wider range of brightness. Bright lights stay bright, and shadows keep their detail. A normal JPEG clips those values at the top and bottom. That wider range is what lets an HDRI light a 3D scene and produce believable reflections.
Do I still need lights with HDRI lighting?
Often you do. The environment gives soft, overall light and reflections. A directional light can still add crisp shadows. Many scenes use both, and I tune the balance for each product rather than assuming that one rule fits every case.
Why does my product look too bright or too dark?
Check the exposure and the colour space first. Confirm that the HDRI loaded as HDR data, not as a standard image. Then test with a different environment, because a bright sky can wash out a light finish on the product.
