Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set useLegacyLights only if necessary to remove warning about deprecated api #5389

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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