{"id":15314677,"url":"https://github.com/unframework/threejs-lightmap-baker","last_synced_at":"2025-10-09T00:32:31.091Z","repository":{"id":54537453,"uuid":"261109250","full_name":"unframework/threejs-lightmap-baker","owner":"unframework","description":"Experimental in-browser lightmap baker (ThreeJS, react-three-fiber)","archived":true,"fork":false,"pushed_at":"2021-02-13T19:44:18.000Z","size":1014,"stargazers_count":58,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-02T08:46:49.340Z","etag":null,"topics":["lightmap","lightmap-baking","react","react-three-fiber","threejs"],"latest_commit_sha":null,"homepage":"https://unframework.com/portfolio/simple-global-illumination-lightmap-baker-for-threejs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-04T07:37:44.000Z","updated_at":"2024-06-27T09:00:40.000Z","dependencies_parsed_at":"2022-08-13T19:01:00.701Z","dependency_job_id":null,"html_url":"https://github.com/unframework/threejs-lightmap-baker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fthreejs-lightmap-baker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fthreejs-lightmap-baker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fthreejs-lightmap-baker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fthreejs-lightmap-baker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unframework","download_url":"https://codeload.github.com/unframework/threejs-lightmap-baker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235781122,"owners_count":19043929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lightmap","lightmap-baking","react","react-three-fiber","threejs"],"created_at":"2024-10-01T08:46:37.555Z","updated_at":"2025-10-09T00:32:25.777Z","avatar_url":"https://github.com/unframework.png","language":"TypeScript","readme":"## THIS REPO HAS MOVED\n\n\u003e All development has moved to https://github.com/pmndrs/react-three-lightmap. Please see that package (published as [@react-three/lightmap](https://www.npmjs.com/package/@react-three/lightmap)) for newer code and documentation.\n\n# Experimental Lightmap Baker for ThreeJS + react-three-fiber\n\n![test screenshot of lightmap generator](https://unframework.files.wordpress.com/2020/06/ao-bake-test-scene2wide.png?w=1140\u0026h=555)\n\nQuick and cheap global illumination lightmap baking in ThreeJS + react-three-fiber.\n\n[Live editable sandbox](https://codesandbox.io/s/github/unframework/threejs-lightmap-baker).\n\nSee screenshots and a brief description here: https://unframework.com/portfolio/simple-global-illumination-lightmap-baker-for-threejs/.\n\nTo try the experimental lightmap display locally, do this:\n\n```sh\ngit clone git@github.com:unframework/threejs-lightmap-baker.git\ncd threejs-lightmap-baker\nyarn\nyarn storybook\n```\n\n## Internal Pipeline Overview\n\nThe developer defines a scene the same way they normally would, but adds IrradianceSurface and IrradianceLight markers under the meshes and lights that should be participating in the lighting process. The lightmap that is produced by the baker can then simply be attached to scene materials via the `lightMap` prop, as usual.\n\nThe following is a brief overview of the renderer architecture.\n\nThe data flows as follows:\n\n```\nmesh/light definition in scene (with surface marker)\n  -\u003e surface manager\n      -\u003e atlas mapper\n          -\u003e lightmap renderer\n              -\u003e lightmap compositor (dummy passthrough for now)\n                  -\u003e final lightmap\n                      -\u003e mesh material in scene\n```\n\nThe surface manager has awareness of all the meshes/lights that affect the lightmap. Before baking can begin, there is an extra step: the atlas mapper has to produce a lookup texture that links every future lightmap texel with the 3D position on a mesh triangle that it corresponds to (based on `uv2` information from meshes).\n\nOnce that lookup texture is built, baking (lightmap rendering) works in passes. It exposes the result texture at all times, so it is possible to see the lightmap being filled in, texel by texel.\n\n~~Because there might be more than one lightmap factors (e.g. dynamic light intensity arrangements), there is a final compositor step that combines the output of multiple bakers (one per factor) into the final lightmap.~~ The lightmap is passed down to the scene via React context so that it can be easily accessed inside sub-components, etc.\n\nBaking is an intensive process and there could be multiple lightmaps being baked at once, which may overload the GPU. There is a top-level \"work manager\" that queues up and schedules work snippets from one or more lightmap bakers - a little bit of work is done per each frame, so that the overall app remains responsive and can render intermediate results.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funframework%2Fthreejs-lightmap-baker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funframework%2Fthreejs-lightmap-baker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funframework%2Fthreejs-lightmap-baker/lists"}