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

Conversation

vincentfretin
Copy link
Contributor

In #5297 we changed to use renderer.useLegacyLights setter instead of the deprecated renderer.physicallyCorrectLights in three r150, and kept the physicallyCorrectLights property name for the renderer system for backward compatibility. The changelog in aframe 1.5.0 release is wrong about this change, it says the reverse, I fixed it in this PR.

In three r155, the useLegacyLights api was also deprecated, such giving this warning
THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.

The warning is shown when you use the setter useLegacyLights.
Because useLegacyLights is false by default now in threejs, we should only set useLegacyLights to true if renderer="physicallyCorrectLights:false" which is still the default in aframe 1.5.0.
I thought we changed the default to match three decision, but we didn't do it for 1.5.0. useLegacyLights will probably be removed in r165, so aframe 1.6.0 will need to switch the default for sure.

I propose to not set useLegacyLights at all when we use renderer="physicallyCorrectLights:true" to remove this warning, this is what this PR does.

@dmarcos dmarcos merged commit d43ce42 into aframevr:master Nov 17, 2023
1 check passed
@dmarcos
Copy link
Member

dmarcos commented Nov 17, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants