app icon indicating copy to clipboard operation
app copied to clipboard

Add Reflection Probes + Reflection Probe Blending

Open lalalune opened this issue 1 year ago • 1 comments

We want to add reflection probes to our https://github.com/webaverse/three/tree/r143 branch of three.js

Mozilla has done this here: https://github.com/MozillaReality/three.js/pull/59/files https://github.com/MozillaReality/three.js/pull/60

Finally, we want to be able to add these reflection probes into our .scn file so they can be loaded and tested. We may need to create a new type like 'application/reflectionprobe' type. This could follow the other apps (see .scn files in the scenes folder for examples of different app implementations)

lalalune avatar Aug 11 '22 19:08 lalalune

Just a heads up, the way we manage our threejs patches is slightly odd. We have a branch called hubs-patches-141 where each commit is an individual patch. This is the current latest version of the reflection probe patch https://github.com/MozillaReality/three.js/commit/7c6fb585ffa7737544871d2bbd4b0864c316f148 but it is best to check https://github.com/MozillaReality/three.js/commits/hubs-patches-141 as it gets rebased sometimes when we need to make changes.

The current implementation is somewhat hacky and fairly barebones, but it mostly works. Note that right now it requires that all reflection probes and the environment map for the scene are all the same resolution. In the version of ThreeJS this patch was originally written for, all environment maps were statically resized during PMREM generation, but that was later changed in ThreeJS, which means that we actually need to properly add support for the secondary environment map (passing its resolution and such), which we just haven't bothered to do yet since our Blender addon just enforces this constraint, and it has not really been a concern for artists.

We are also keeping an eye on GLTF extensions in this space, and work being done in upstream ThreeJS.

netpro2k avatar Aug 19 '22 05:08 netpro2k