[Merged by Bors] - Increase the MAX_DIRECTIONAL_LIGHTS from 1 to 10#6066
[Merged by Bors] - Increase the MAX_DIRECTIONAL_LIGHTS from 1 to 10#6066kurtkuehnert wants to merge 9 commits intobevyengine:mainfrom
MAX_DIRECTIONAL_LIGHTS from 1 to 10#6066Conversation
|
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 |
|
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.