Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 2.5 KB

custom_aframe_build.md

File metadata and controls

54 lines (44 loc) · 2.5 KB

Create an aframe build with LUTToneMapping and reflection probes support

I implemented support for "LUTToneMapping" (Blender 'Filmic') tone mapping so the scene is bright like in hubs instead of using by default "ACESFilmicToneMapping" (ThreeJS 'ACES Filmic'). Related code in hubs:

see the code in inflators/environment-settings.js

For this to work, you need a custom build of aframe. Here is how to create an aframe master (pre 1.7.0 release) / three 168 build with the required patch in threejs:

git clone [email protected]:supermedium/three.js.git super-three
git clone [email protected]:aframevr/aframe.git

cd aframe
git pull
git checkout 2aca98cbbc5f1f03431ce07f107709baa1718df8 # master pre 1.7.0 2024-09-08 r168
rm -rf package-lock.json node_modules
npm install

cd ../super-three
git remote add hubs [email protected]:MozillaReality/three.js.git
git remote add vincentfretin [email protected]:vincentfretin/three.js.git
git fetch origin
git fetch hubs
git checkout super-168 # look at the super-three version in aframe/package.json and adapt the branch accordingly
git checkout -b super-168-lut

# https://github.com/mrdoob/three.js/compare/dev...MozillaReality:three.js:hubs-patches-147
# Note: cherry-pick the commit from the previous branch to avoid conflicts
# PannerNode optimization https://github.com/MozillaReality/three.js/commit/d11c1b5674a614bc1b95fef746e8a81e65c8263a
git cherry-pick d11c1b5674a614bc1b95fef746e8a81e65c8263a
# Don't apply IBL irradiance to lightmapped objects https://github.com/MozillaReality/three.js/commit/42dec78a61db57bc7ae0cde025248c39d4a4a9cf
git cherry-pick 42dec78a61db57bc7ae0cde025248c39d4a4a9cf
# LUT tone mapping https://github.com/MozillaReality/three.js/commit/89c223982b5a95dd27d557bf8386c894fa80188d
git cherry-pick 89c223982b5a95dd27d557bf8386c894fa80188d
# Reflection probes https://github.com/MozillaReality/three.js/commit/2d3039919f26dc74f0444f8970ac122ec146ddf6
git cherry-pick 2d3039919f26dc74f0444f8970ac122ec146ddf6
git push --set-upstream vincentfretin super-168-lut
rm -rf node_modules/ package-lock.json
npm install
npm run build
git commit -am"Build dist"
git push
cp build/three.* ../aframe/node_modules/three/build/

cd ../aframe
npm run dist

cp dist/aframe-master.min.js* ../gltf-model-plus/dist/