LookLightweight
Baked vs realtime lighting
Light computed ahead of time, or live every frame.
Two ways to light a scene. Compute the light once ahead of time and paint it onto the surfaces: fast, and nothing can move. Or compute it live every frame: anything can move, and the phone gets hot. Most portfolio scenes mix a baked room with one live light.
- Breaks when
- baked scenes cannot moverealtime shadows are the first thing to kill mobile
- Also called
- lightmap, AO bake, shadow maps
Prompts
Decide for this scene
A hero scene with a static room (walls, furniture) and one product that rotates. Propose the lighting split: bake the room’s lightmap and AO in Blender (Cycles, 512 samples, denoised, 2048 map), keep one DirectionalLight with a 1024 shadow map that only the product casts and only the floor receives. Write the Three.js setup with castShadow/receiveShadow set on exactly the right objects and no other lights.
Shadow quality without the cost
Improve a blurry, flickering shadow in this Three.js scene [paste]: tighten the light’s orthographic shadow camera to the object’s bounding box, set shadow.bias and normalBias, use PCFSoftShadowMap, size 2048 on desktop and 1024 on mobile, and add a ContactShadows-style blurred plane for the soft part. Show before/after frame times.
Split-screen explainer
Render the same scene twice side by side: left with a baked lightmap and no lights, right with realtime lights and shadows. A moving light orbits both; only the right side responds. Print draw calls and frame time under each half so the trade-off is visible.
Related
Resources · 3
- three.js example: colored shadows (castShadowNode)castShadowNode returns a color instead of black: shadows tinted like glass.mrdoobsite · code · demoOct 4, 2026
- Bruno Simon portfolioDrive a car through a baked scene; the reference 3D portfolio.bruno_simonsite · demoAug 15, 2026
- three.js example: lightmapmrdoobsite · code · demoApr 20, 2026