-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Increase the MAX_DIRECTIONAL_LIGHTS
from 1 to 10
#6066
Conversation
Have you tested this in WebGL? I vaguely remember there being a restriction there, but maybe I'm mistaken. |
No I have not, I am not sure how to compile and test on WebGL. Hopefully @superdump knows more. |
doesn't work in wasm:
#5900 would let us have a different const value in the shader depending on the arch 🥷 |
this should work if you add a check to render\light.rs @ 1120 to make sure the number of shadow-enabled directional lights does not exceed you might also need to sort the directional lights to get the chosen shadow-caster to be stable. |
…ts are exceeding the supported amount
Thanks for your feedback. I have now added errors if spot/directional lights exceeds the maximum supported amount. I think this is pretty much what @robtfm recommended. Do you think it would be a good idea to separate the directional lights into their own uniform/storage buffer in a follow up PR or are they simply to few to really matter? |
i don't think we should disable all the directional+spotlight shadow maps when the max is exceeded. i would prefer to leave the count calculations as they were and just add the the errors will be emitted every frame and are not really "errors"... i would suggest either silently ignoring them (that would be my pref for the shadow map count warning, it's the same treatment as point light shadows), or using a warning and a Local to check if the warning has already been emitted similar to in |
tested win32 and wasm, looks good to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
bors r+ |
# Objective Currently we are limiting the amount of direction lights in a scene to one. ## Solution Increase the amount of direction lights from 1 to 10. This still is not a perfect solution, but should unblock many use cases. We could probably just store the directional lights similar to the point lights in an storage buffer, allowing for an variable amount of directional lights. Co-authored-by: Kurt Kühnert <51823519+Ku95@users.noreply.github.com>
MAX_DIRECTIONAL_LIGHTS
from 1 to 10MAX_DIRECTIONAL_LIGHTS
from 1 to 10
# Objective Currently we are limiting the amount of direction lights in a scene to one. ## Solution Increase the amount of direction lights from 1 to 10. This still is not a perfect solution, but should unblock many use cases. We could probably just store the directional lights similar to the point lights in an storage buffer, allowing for an variable amount of directional lights. Co-authored-by: Kurt Kühnert <51823519+Ku95@users.noreply.github.com>
Objective
Currently we are limiting the amount of direction lights in a scene to one.
Solution
Increase the amount of direction lights from 1 to 10.
This still is not a perfect solution, but should unblock many use cases.
We could probably just store the directional lights similar to the point lights in an storage buffer, allowing for an variable amount of directional lights.