Skip to content

Commit

Permalink
Set useLegacyLights only if necessary to remove warning about depreca…
Browse files Browse the repository at this point in the history
…ted api (#5389)

* Fix wrong changelog in 1.5.0 about the useLegacyLights change

* Set useLegacyLights only if necessary to remove warning about deprecated useLegacyLights api since three r155
  • Loading branch information
vincentfretin authored Nov 17, 2023
1 parent a06956d commit d43ce42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Multiview extension, Spatial computing UIs, Mixed Reality features, Hand manipul

### Bug fixes

- Use renderer.physicallyCorrectLights instead of the now deprecated renderer.useLegacyLights (fix #5293) (@mrx)
- Use renderer.useLegacyLights instead of the deprecated renderer.physicallyCorrectLights in three r150, but keep the physicallyCorrectLights property name for the renderer system for backward compatibility (fix #5293) (@mrx)
- Fix `hand-controls` animations (#5300)
- Fix outdated link in error message (#5313) (fix #5275) (@kolson25)
- Fix visibility of controller in model-viewer example (#5317) (@DougReeder)
Expand Down
4 changes: 3 additions & 1 deletion src/systems/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ module.exports.System = registerSystem('renderer', {
// This is the rendering engine, such as THREE.js so copy over any persistent properties from the rendering system.
var renderer = sceneEl.renderer;

renderer.useLegacyLights = !data.physicallyCorrectLights;
if (!data.physicallyCorrectLights) {
renderer.useLegacyLights = !data.physicallyCorrectLights;
}
renderer.toneMapping = THREE[toneMappingName + 'ToneMapping'];
THREE.Texture.DEFAULT_ANISOTROPY = data.anisotropy;

Expand Down

0 comments on commit d43ce42

Please sign in to comment.