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
Implementation of the final API for clustered lighting, shadowType support #3763
Conversation
If there is one scene per app, so one clustered lighting per app, would it be better to have such API (less depth): |
The longer team goal is to make multi Scene supported. Scene would represent its set up - global lighting, fog, clustered lighting and similar. But due to many shortcuts taken in how this was put together, this is not possible at the moment, and so there is no reason to expose Scene constructor. But I don't want to close this door. |
My knee-jerk reaction is that the property names are quite verbose. So presumably we're heading for a world where it's not really 'clustered lighting' any more but just 'lighting' (because we plan to dump the current lighting system). So, I'm thinking more along the lines of:
I've not included Also, keep in mind that the Editor codebase does call the |
# Conflicts: # src/scene/renderer/forward-renderer.js
great suggestions @willeastcott - I've done just that, but additionally renamed |
This PR introduces |
Clustered lighting ignores shadowType on the LightComponent, and all cluster lights use the same shadow filtering. If at some point we switch to clustered lighting as a main lighting system, only directional lights will have shadowType exposed on the component. Similarly to shadow resolution - this is automatically assigned from the atlas. We could possibly do the same with light attenuation - this is per light, as it's reasonably cheap .. but personally I would make it global for cluster lights to save all dynamic branches we can. |
Do we prefer I can find a few precedents for
|
Good question. I like We also have lightmapFilterEnabled. But I don't mind either way. |
the naming agreed to in a discussion:
|
# Conflicts: # src/graphics/program-lib/programs/standard.js # src/scene/materials/standard-material-options-builder.js # src/scene/scene.js
To me |
to me, |
OK, @mvaligursky, while I'm still a little torn on this, I'll go with xxxEnabled. |
Clustered lighting API has been updated to its final form.
New API (still private)
Old API (removed)
Other changes
Clustered shadow filtering: support for PCF1, 3 and 5 filtering for clustered shadows (PCF5 is WebGl2 only, falls backs to PCF3 on WebGl1). Details about added PCF1: