Baking

Precomputing slow things (lighting, shadows, occlusion, surface detail) into textures once, so runtime just reads an image.

freeze the lighting into an imagepre-render the shadowslightmapbake the lightingbaked shadowsbaking texturesbake normals from the high polyprebaked ambient occlusion

See it

Live demo coming soon

What it is

Baking moves expensive work from runtime to build time by rendering the result into a texture. The classic case is lighting: run a proper path tracer in Blender once, save the bounce light and soft shadows into a lightmap, and at runtime the browser just samples an image. Ten seconds of offline compute buys you a scene that looks ray traced and runs on a phone. The same trick bakes ambient occlusion into an AO map and bakes a million-triangle sculpt's detail into a normal map on a low poly cage.

It is the single biggest quality-per-millisecond win in web 3D, and most beautiful three.js sites are baked, not lit live. Requirement: the lighting and the geometry have to hold still. Baked light on a moving object is wrong the moment it moves.

Gotcha: a lightmap needs a unique, non-overlapping UV channel, and that is normally a second one added just for the bake. Tiling UVs are fine for a color texture (many faces can share the same patch) but a lightmap needs every face to own unique space, or shadows bleed onto unrelated surfaces. Other bakes are less fussy: an AO or normal bake can ride on the primary UV set as long as its islands do not overlap. Budget for that unwrap, add padding between islands so mipmaps do not smear across seams, and remember baked maps are big: compress them with KTX2.

Ask AI for it

Bake the indirect lighting for this static scene instead of computing it live. In Blender: add a second UV map with a non-overlapping Smart UV Project unwrap plus island padding, then bake indirect diffuse plus ambient occlusion in Cycles into a 2048px lightmap on that channel, and export the mesh as glTF with both UV sets intact. In three.js: assign the baked image as the material's lightMap on uv2 (not as map), leave base color on the primary UVs, drop the real-time lights and shadows the bake replaced, and compress the texture to KTX2. If you would rather bake Combined instead, that image is already the finished lit color, so render it through an unlit MeshBasicMaterial or an emissive material rather than feeding it in as a PBR lightMap. Keep only moving objects on dynamic lighting.

You might have meant

ambient occlusionnormal mapuv mapping uv unwrappingshadow mapping shadow acne peter panningtexture