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

Remove renderer physicallyCorrectLights property and update default lighting setup (r165) #5546

Open
vincentfretin opened this issue Jun 26, 2024 · 5 comments

Comments

@vincentfretin
Copy link
Contributor

Description:

  • A-Frame Version: aframe master (post 1.6.0) with r165 and above
  • Platform / Device: all

WebGLRenderer.useLegacyLights was removed in three r165, default scene now looks much darker.
We really should've defaulted to useLegacyLights=false (physicallyCorrectLights true in aframe renderer) when we switched the default for colorManagement to true in aframe 1.5.0, but that's done we can't go back in the past.

We should:

  • Remove the renderer physicallyCorrectLights property that is now always true. No way to put that to false anymore.
  • Update the default lighting setup to be roughly the same than when physicallyCorrectLights was false
  • Document the breaking change for aframe 1.7.0, users will have to adjust their own lighting
  • In parallel, we may change the lights intensity in the environment component for all presets as well and do a minor release 1.4.0
@mrxz
Copy link
Contributor

mrxz commented Jun 26, 2024

For context: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733#migrating-2:

The intensities for ambient, hemisphere, directional lights and light maps can be restored by multiplying PI with the existing light intensity values.

Also, since things won't be the exact same as before, let's also update the default decay value for lights to 2 (matching Three.js defaults). That way the A-Frame defaults should be correct for physically accurate lighting out of the box:

It’s important to understand that using the new lighting mode is just one prerequisite for physically correct lighting. You also have to:

  • apply a real-world scale to your scene (meaning 1 world unit = 1 meter).
  • not change the default decay values of 2 for all spot and point lights in your scene.

@dmarcos
Copy link
Member

dmarcos commented Jul 22, 2024

Anyone wants to open a PR?

@vincentfretin
Copy link
Contributor Author

Each point I mentioned can be a separate PR, but the two first points are probably good to do together. That may be a good first time contribution if anyone wants to contribute.

@mrxz maybe you know, is there maybe some formula we can apply to find the equivalent light color to have more or less the same rendering?

@mrxz
Copy link
Contributor

mrxz commented Aug 28, 2024

@mrxz maybe you know, is there maybe some formula we can apply to find the equivalent light color to have more or less the same rendering?

The colour itself does not need to be changed, only the intensity by a factor of PI. Since the decay/falloff is different the results won't be identical, but there isn't really anything that can be done about that. Though I expect that the difference won't really be noticeable.

@dmarcos
Copy link
Member

dmarcos commented Sep 6, 2024

Looking to cut A-Frame 1.7.0 and we need this fixed. Anyone want to volunteer PRs?

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

No branches or pull requests

3 participants