All Projects → pmndrs → react-three-lightmap

pmndrs / react-three-lightmap

Licence: MIT license
In-browser lightmap/AO baker for react-three-fiber and ThreeJS

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-three-lightmap

three-js-fundamentals-r3f
Examples from the Three.js Fundamentals website recreated in react-three-fiber renderer.
Stars: ✭ 84 (-21.5%)
Mutual labels:  react-three-fiber, r3f
easy lightmap
blender easy light map addon
Stars: ✭ 19 (-82.24%)
Mutual labels:  lightmap
use-ammojs
ammo.js physics for use with react-three-fiber
Stars: ✭ 16 (-85.05%)
Mutual labels:  react-three-fiber
caroumesh
A React component to display 3d models in a carousel-like fashion.
Stars: ✭ 63 (-41.12%)
Mutual labels:  react-three-fiber
typefaces
Collection of Google fonts as typeface data for usage with three.js, react-three-fiber, and other tools.
Stars: ✭ 53 (-50.47%)
Mutual labels:  react-three-fiber
racing-game-cljs
A 3D racing game built with ClojureScript, React and ThreeJS
Stars: ✭ 209 (+95.33%)
Mutual labels:  react-three-fiber
bf-3
my personal site, bf.wtf version 3
Stars: ✭ 58 (-45.79%)
Mutual labels:  react-three-fiber
EduSmart
It utilizes 3D, Augmented reality to give real-life simulations or feels of various models and make the learning process more impactful and fascinating. With an interactive live feature, students can ask the teacher their doubts instantly and also discuss.
Stars: ✭ 23 (-78.5%)
Mutual labels:  react-three-fiber
spacesvr
A standardized reality for the future of the 3D Web.
Stars: ✭ 135 (+26.17%)
Mutual labels:  react-three-fiber
react-three-arjs
AR.js with react-three-fiber
Stars: ✭ 88 (-17.76%)
Mutual labels:  react-three-fiber

@react-three/lightmap

In-browser lightmap and ambient occlusion (AO map) baker for react-three-fiber and ThreeJS.

example screenshot of lightmap baker output

Example:

<Lightmap>
  <mesh position={[0, 0, 0]} castShadow receiveShadow>
    <boxBufferGeometry attach="geometry" args={[3, 3, 1]} />
    <meshStandardMaterial attach="material" color="#ff6080" />
  </mesh>

  <mesh position={[0, 0, 1.8]} castShadow receiveShadow>
    <boxBufferGeometry attach="geometry" args={[2, 2, 2]} />
    <meshStandardMaterial attach="material" color="#4080ff" />
  </mesh>
</Lightmap>

Try it in this editable sandbox.

NOTE: 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.

To 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.

Local Development

git clone [email protected]:pmndrs/react-three-lightmap.git
cd react-three-lightmap
yarn
yarn storybook

Wishlist

  • onComplete callback
  • proper denoising, calibrate the light sampler
  • much more optimization
  • composited multi-layer lightmap based on several distinct groups of light sources
    • e.g. for individual flickering lights, neon signs, etc
  • rudimentary light probe support for dynamic meshes/sprites
    • can start with just omnidirectional total amounts collected in 2D grid textures
    • might want the light probe pattern to be customizable
  • bake-only lights (turned off after bake)
    • useful for game levels - e.g. could have hundreds of lights baked in and then discarded
    • currently the lightmap is indirect-only, so this needs an extra step to sample direct light contribution
  • saving/loading the generated lightmap texture (useful for game levels)

Notes

Based on original experimental implementation by @unframework.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].