{"id":13773168,"url":"https://github.com/pmndrs/react-three-lightmap","last_synced_at":"2025-05-07T13:21:13.696Z","repository":{"id":40274458,"uuid":"337049392","full_name":"pmndrs/react-three-lightmap","owner":"pmndrs","description":"In-browser lightmap/AO baker for react-three-fiber and ThreeJS","archived":false,"fork":false,"pushed_at":"2023-01-25T06:15:34.000Z","size":685,"stargazers_count":136,"open_issues_count":3,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-21T04:32:32.625Z","etag":null,"topics":["ambient-occlusion","ao","ao-baker","lightmap","lightmap-baker","r3f","react","react-three-fiber","threejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmndrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-08T11:11:43.000Z","updated_at":"2025-04-12T16:46:03.000Z","dependencies_parsed_at":"2023-02-14T05:16:49.606Z","dependency_job_id":null,"html_url":"https://github.com/pmndrs/react-three-lightmap","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmndrs%2Freact-three-lightmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmndrs%2Freact-three-lightmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmndrs%2Freact-three-lightmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmndrs%2Freact-three-lightmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmndrs","download_url":"https://codeload.github.com/pmndrs/react-three-lightmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250832169,"owners_count":21494525,"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":["ambient-occlusion","ao","ao-baker","lightmap","lightmap-baker","r3f","react","react-three-fiber","threejs"],"created_at":"2024-08-03T17:01:12.273Z","updated_at":"2025-05-07T13:21:13.664Z","avatar_url":"https://github.com/pmndrs.png","language":"TypeScript","readme":"# @react-three/lightmap\n\n**In-browser lightmap and ambient occlusion (AO map) baker for react-three-fiber and ThreeJS.**\n\n![example screenshot of lightmap baker output](./react-three-lightmap-example.png)\n\nExample:\n\n```jsx\n\u003cLightmap\u003e\n  \u003cmesh position={[0, 0, 0]} castShadow receiveShadow\u003e\n    \u003cboxBufferGeometry attach=\"geometry\" args={[3, 3, 1]} /\u003e\n    \u003cmeshStandardMaterial attach=\"material\" color=\"#ff6080\" /\u003e\n  \u003c/mesh\u003e\n\n  \u003cmesh position={[0, 0, 1.8]} castShadow receiveShadow\u003e\n    \u003cboxBufferGeometry attach=\"geometry\" args={[2, 2, 2]} /\u003e\n    \u003cmeshStandardMaterial attach=\"material\" color=\"#4080ff\" /\u003e\n  \u003c/mesh\u003e\n\u003c/Lightmap\u003e\n```\n\n**[Try it in this editable sandbox](https://codesandbox.io/s/github/pmndrs/react-three-lightmap/tree/v0.0.8/demo-sandbox)**.\n\nNOTE: actual lightmap rendering is performed on a separate hidden canvas and WebGL context. If you are consuming any context in your lightmapped content, you will need to \"bridge\" that context.\n\nTo track when baking is complete, provide `onComplete` callback to `Lightmap` - it will be called with the resulting texture as the first argument. The library does automatically assign that texture as the lightmap on all the baked mesh materials too.\n\n## Local Development\n\n```sh\ngit clone git@github.com:pmndrs/react-three-lightmap.git\ncd react-three-lightmap\nyarn\nyarn storybook\n```\n\n## Wishlist\n\n- ~~onComplete callback~~\n- proper denoising, calibrate the light sampler\n- much more optimization\n- composited multi-layer lightmap based on several distinct groups of light sources\n  - e.g. for individual flickering lights, neon signs, etc\n- rudimentary light probe support for dynamic meshes/sprites\n  - can start with just omnidirectional total amounts collected in 2D grid textures\n  - might want the light probe pattern to be customizable\n- bake-only lights (turned off after bake)\n  - useful for game levels - e.g. could have hundreds of lights baked in and then discarded\n  - currently the lightmap is indirect-only, so this needs an extra step to sample direct light contribution\n- saving/loading the generated lightmap texture (useful for game levels)\n\n## Notes\n\nBased on [original experimental implementation](https://github.com/unframework/threejs-lightmap-baker) by [@unframework](https://github.com/unframework).\n","funding_links":[],"categories":["3D"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmndrs%2Freact-three-lightmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmndrs%2Freact-three-lightmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmndrs%2Freact-three-lightmap/lists"}