From 8813d3d2818634ed4900409d99544b60587aa300 Mon Sep 17 00:00:00 2001 From: Diego Marcos Segura Date: Mon, 11 Nov 2024 20:35:45 -0800 Subject: [PATCH] Adjust light intensity defaults and examples values to account for WebGLRenderer.useLegacyLights deprecation in THREE r165 --- examples/animation/aframe-logo/index.html | 2 +- examples/animation/arms/index.html | 2 +- examples/animation/generic-logo/index.html | 2 +- examples/animation/pivots/index.html | 2 +- examples/animation/plane-reveals/index.html | 2 +- examples/animation/unfold/index.html | 2 +- examples/animation/warps/index.html | 2 +- examples/boilerplate/ar-hello-world/index.html | 6 +++--- examples/boilerplate/webxr-ar-lighting/index.html | 4 ++-- examples/docs/community-components/index.html | 8 ++++---- examples/primitives/models/index.html | 2 +- examples/primitives/planes/index.html | 4 ++-- examples/showcase/anime-UI/index.html | 4 ++-- examples/showcase/dynamic-lights/index.html | 2 +- examples/showcase/link-traversal/egypt.html | 2 +- examples/showcase/link-traversal/forest.html | 2 +- examples/showcase/link-traversal/japan.html | 2 +- examples/showcase/model-viewer/model-viewer.js | 4 ++-- examples/showcase/shopping/index.html | 2 +- examples/showcase/tracked-controls/index.html | 6 +++--- examples/test/animation/index.html | 2 +- examples/test/geometry-gallery/index.html | 2 +- examples/test/laser-controls/index.html | 4 ++-- examples/test/physical/index.html | 2 +- examples/test/shadows/index.html | 6 +++--- examples/test/towers/index.html | 4 ++-- src/components/light.js | 2 +- src/components/scene/reflection.js | 2 +- src/systems/light.js | 2 +- 29 files changed, 44 insertions(+), 44 deletions(-) diff --git a/examples/animation/aframe-logo/index.html b/examples/animation/aframe-logo/index.html index 29999806d8b..0b47b782c9f 100644 --- a/examples/animation/aframe-logo/index.html +++ b/examples/animation/aframe-logo/index.html @@ -104,7 +104,7 @@ - + diff --git a/examples/animation/arms/index.html b/examples/animation/arms/index.html index de2785be4d0..4869d1e6f15 100644 --- a/examples/animation/arms/index.html +++ b/examples/animation/arms/index.html @@ -257,7 +257,7 @@ - + diff --git a/examples/animation/generic-logo/index.html b/examples/animation/generic-logo/index.html index bfc8ce1f5f1..a33b31d5e11 100644 --- a/examples/animation/generic-logo/index.html +++ b/examples/animation/generic-logo/index.html @@ -60,7 +60,7 @@ animation__position="property: position; to: 0 -0.7 0; delay: 1000; dur: 1000; easing: easeOutCubic"> - + diff --git a/examples/animation/pivots/index.html b/examples/animation/pivots/index.html index a52c2c34c62..42d94839b56 100644 --- a/examples/animation/pivots/index.html +++ b/examples/animation/pivots/index.html @@ -43,7 +43,7 @@ - + diff --git a/examples/animation/plane-reveals/index.html b/examples/animation/plane-reveals/index.html index b7b57a3354b..ca2f025675c 100644 --- a/examples/animation/plane-reveals/index.html +++ b/examples/animation/plane-reveals/index.html @@ -33,7 +33,7 @@ - + diff --git a/examples/animation/unfold/index.html b/examples/animation/unfold/index.html index f44d9598885..395d7df5757 100644 --- a/examples/animation/unfold/index.html +++ b/examples/animation/unfold/index.html @@ -32,7 +32,7 @@ - + diff --git a/examples/animation/warps/index.html b/examples/animation/warps/index.html index 0b62a8e0443..006d5e74c72 100644 --- a/examples/animation/warps/index.html +++ b/examples/animation/warps/index.html @@ -107,7 +107,7 @@ - + diff --git a/examples/boilerplate/ar-hello-world/index.html b/examples/boilerplate/ar-hello-world/index.html index 7c7246435dc..b53148ee161 100644 --- a/examples/boilerplate/ar-hello-world/index.html +++ b/examples/boilerplate/ar-hello-world/index.html @@ -9,9 +9,9 @@ AFRAME.registerComponent('follow-shadow', { schema: {type: 'selector'}, init() {this.el.object3D.renderOrder = -1;}, - tick() { + tick() { if (this.data) { - this.el.object3D.position.copy(this.data.object3D.position); + this.el.object3D.position.copy(this.data.object3D.position); this.el.object3D.position.y-=0.001; // stop z-fighting } } @@ -26,7 +26,7 @@ shadow="type:pcfsoft" xr-mode-ui="XRMode: xr" > - + diff --git a/examples/boilerplate/webxr-ar-lighting/index.html b/examples/boilerplate/webxr-ar-lighting/index.html index a831ea098a8..ec7889c48d9 100644 --- a/examples/boilerplate/webxr-ar-lighting/index.html +++ b/examples/boilerplate/webxr-ar-lighting/index.html @@ -25,8 +25,8 @@ - - + diff --git a/examples/docs/community-components/index.html b/examples/docs/community-components/index.html index 3fa286d173e..5dde38a3179 100644 --- a/examples/docs/community-components/index.html +++ b/examples/docs/community-components/index.html @@ -12,21 +12,21 @@ - + - + - + diff --git a/examples/primitives/models/index.html b/examples/primitives/models/index.html index 79edaa36219..18bac08a87c 100644 --- a/examples/primitives/models/index.html +++ b/examples/primitives/models/index.html @@ -55,7 +55,7 @@ - + diff --git a/examples/primitives/planes/index.html b/examples/primitives/planes/index.html index f8ea12261cd..190deec192a 100644 --- a/examples/primitives/planes/index.html +++ b/examples/primitives/planes/index.html @@ -11,7 +11,7 @@ - + - + diff --git a/examples/showcase/anime-UI/index.html b/examples/showcase/anime-UI/index.html index d9825f64a65..03f35749eb5 100644 --- a/examples/showcase/anime-UI/index.html +++ b/examples/showcase/anime-UI/index.html @@ -150,8 +150,8 @@ - - + + diff --git a/examples/showcase/dynamic-lights/index.html b/examples/showcase/dynamic-lights/index.html index 49107d076ed..665973ce709 100644 --- a/examples/showcase/dynamic-lights/index.html +++ b/examples/showcase/dynamic-lights/index.html @@ -45,7 +45,7 @@ + light="color: #DDDDFF; distance: 120; intensity: 6.28; type: point"> - + diff --git a/examples/showcase/link-traversal/forest.html b/examples/showcase/link-traversal/forest.html index 31f3ca74c2a..dce8faa5b6d 100644 --- a/examples/showcase/link-traversal/forest.html +++ b/examples/showcase/link-traversal/forest.html @@ -28,7 +28,7 @@ - + diff --git a/examples/showcase/link-traversal/japan.html b/examples/showcase/link-traversal/japan.html index 115caffc60f..82cf4b915e8 100644 --- a/examples/showcase/link-traversal/japan.html +++ b/examples/showcase/link-traversal/japan.html @@ -27,7 +27,7 @@ - + diff --git a/examples/showcase/model-viewer/model-viewer.js b/examples/showcase/model-viewer/model-viewer.js index 8d7ca0e8595..3823f5fdf03 100644 --- a/examples/showcase/model-viewer/model-viewer.js +++ b/examples/showcase/model-viewer/model-viewer.js @@ -209,7 +209,7 @@ AFRAME.registerComponent('model-viewer', { sceneLightEl.setAttribute('light', { type: 'hemisphere', - intensity: 1 + intensity: 3.14 }); sceneLightEl.setAttribute('hide-on-enter-ar', ''); @@ -274,7 +274,7 @@ AFRAME.registerComponent('model-viewer', { shadowCameraRight: 5, shadowCameraBottom: -5, shadowCameraTop: 5, - intensity: 0.5, + intensity: 1.57, target: 'modelPivot' }); diff --git a/examples/showcase/shopping/index.html b/examples/showcase/shopping/index.html index e3fdb755ba1..44295960c39 100644 --- a/examples/showcase/shopping/index.html +++ b/examples/showcase/shopping/index.html @@ -40,7 +40,7 @@ - + diff --git a/examples/showcase/tracked-controls/index.html b/examples/showcase/tracked-controls/index.html index 42964085bfe..3bcdaac3e36 100644 --- a/examples/showcase/tracked-controls/index.html +++ b/examples/showcase/tracked-controls/index.html @@ -58,9 +58,9 @@ geometry="primitive: sphere; radius: 65;" material="shader: skyGradient; colorTop: #353449; colorBottom: #BC483E; side: back"> - - - + + + diff --git a/examples/test/animation/index.html b/examples/test/animation/index.html index 3f1628230cf..36c472c8573 100644 --- a/examples/test/animation/index.html +++ b/examples/test/animation/index.html @@ -21,7 +21,7 @@ - + diff --git a/examples/test/geometry-gallery/index.html b/examples/test/geometry-gallery/index.html index 66fcb41f65f..c106ad606c0 100644 --- a/examples/test/geometry-gallery/index.html +++ b/examples/test/geometry-gallery/index.html @@ -43,7 +43,7 @@ height: .1; width: 1;" material="color: #FFF" position="0 .1 0"> - diff --git a/examples/test/laser-controls/index.html b/examples/test/laser-controls/index.html index ece7623b591..81bb15e8640 100644 --- a/examples/test/laser-controls/index.html +++ b/examples/test/laser-controls/index.html @@ -53,7 +53,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/examples/test/physical/index.html b/examples/test/physical/index.html index 8075b8b7787..0ad824eb245 100644 --- a/examples/test/physical/index.html +++ b/examples/test/physical/index.html @@ -47,7 +47,7 @@ diff --git a/examples/test/shadows/index.html b/examples/test/shadows/index.html index ffe7251ed2d..b89530a85b6 100644 --- a/examples/test/shadows/index.html +++ b/examples/test/shadows/index.html @@ -21,17 +21,17 @@ + animation="property: intensity; to: 3.14; dur: 3000; dir: alternate; loop: true"> diff --git a/examples/test/towers/index.html b/examples/test/towers/index.html index 34eca9cbd92..a75c2067ebc 100644 --- a/examples/test/towers/index.html +++ b/examples/test/towers/index.html @@ -36,12 +36,12 @@ - diff --git a/src/components/light.js b/src/components/light.js index c7d2f57c47e..b74f1833c48 100644 --- a/src/components/light.js +++ b/src/components/light.js @@ -22,7 +22,7 @@ module.exports.Component = registerComponent('light', { groundColor: {type: 'color', if: {type: ['hemisphere']}}, decay: {default: 1, if: {type: ['point', 'spot']}}, distance: {default: 0.0, min: 0, if: {type: ['point', 'spot']}}, - intensity: {default: 1.0, min: 0, if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe']}}, + intensity: {default: 3.14, min: 0, if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe']}}, penumbra: {default: 0, min: 0, max: 1, if: {type: ['spot']}}, type: { default: 'directional', diff --git a/src/components/scene/reflection.js b/src/components/scene/reflection.js index b69a28ce5b9..8ad39ddd6ea 100644 --- a/src/components/scene/reflection.js +++ b/src/components/scene/reflection.js @@ -9,7 +9,7 @@ function updateLights (estimate, probeLight, directionalLight, directionalLightP estimate.primaryLightIntensity.z)); probeLight.sh.fromArray(estimate.sphericalHarmonicsCoefficients); - probeLight.intensity = 1; + probeLight.intensity = 3.14; if (directionalLight) { directionalLight.color.setRGB( diff --git a/src/systems/light.js b/src/systems/light.js index 4d2fd18e148..68e11da7e48 100755 --- a/src/systems/light.js +++ b/src/systems/light.js @@ -72,7 +72,7 @@ module.exports.System = registerSystem('light', { sceneEl.appendChild(ambientLight); directionalLight = document.createElement('a-entity'); - directionalLight.setAttribute('light', {color: '#FFF', intensity: 0.6, castShadow: true}); + directionalLight.setAttribute('light', {color: '#FFF', intensity: 1.884, castShadow: true}); directionalLight.setAttribute('position', {x: -0.5, y: 1, z: 1}); directionalLight.setAttribute(DEFAULT_LIGHT_ATTR, ''); directionalLight.setAttribute(constants.AFRAME_INJECTED, '');