Skip to content

About

Original browser-local WebGL lightmap baker for Three.js with path-traced GI, automatic UVs, BVH ray tracing, AO and denoising.

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

348 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LightBaker — original WebGL implementation

This MIT-licensed repository is the original browser-local LightBaker for Three.js: a maintained WebGL package and reference implementation. The separate lightbaker-web repository contains the newer public Studio/client surface; its public deployment is intentionally held until the hosted backend is ready.

This package is intentionally WebGL-only. It requires THREE.WebGLRenderer. THREE.WebGPURenderer is not supported, including its WebGL fallback mode. WebGPU, cloud/headless execution, and the next-generation baking backend are not developed in this repository.

Cornell scene after browser-local bake

Demo

Try the baker in the browser: https://ibrahim-3d.github.io/three-lightmap-baker/ (desktop, WebGL2; a discrete GPU is recommended for full bakes). The playground source is apps/playground; run it locally with pnpm dev and build it with pnpm build:demo.

Documentation

The documentation lives in /docs in this repository (the authoritative source); the repository Wiki can serve as a friendlier manual. GitHub Pages hosts the demo above.

Install

npm install lightmap-baker three

Compatibility

Area Supported
Three.js >=0.185.1 <0.186.0
Renderer THREE.WebGLRenderer
Graphics API WebGL 2 + EXT_color_buffer_float
THREE.WebGPURenderer No
WebGPURenderer({ forceWebGL: true }) No
Node/headless baking No
Bake-target materials MeshStandardMaterial, MeshPhysicalMaterial

The bake pipeline uses WebGL2/GLSL ES 3.0 internally. That does not mean arbitrary application shaders are supported. Custom ShaderMaterial, RawShaderMaterial, node/TSL materials, and custom shader logic are outside the v1.1 bake-material contract.

Diffuse transport supports material.color × material.map, UV0/UV1, geometry groups/material arrays, shared material instances, and solid emissive color. Normal maps, roughness/metalness maps, emissiveMap, transparency/transmission, vertex colors, and custom shaders are not fully transported and may be approximated or ignored.

The original playground/editor remains available in Git history. This repository now contains only the WebGL library, examples, documentation and correctness tests.

Develop

pnpm install --frozen-lockfile
pnpm run typecheck
pnpm run typecheck:examples
pnpm run build
pnpm run test:api-import
pnpm run test:correctness

Browser correctness tests require Playwright Chromium. Hardware-dependent lighting quality needs a real GPU and should be checked on suitable hardware.

MIT License

About

Original browser-local WebGL lightmap baker for Three.js with path-traced GI, automatic UVs, BVH ray tracing, AO and denoising.

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages