guiyudi
January 21, 2025, 10:54am
1
Godot Version
4.3 stable
So I am aware that DirectionalLight3D cull masks had a problem in Godot 3 and it wasn’t working. Has this issue been addressed, or is it still not working? I’m trying to exclude a visual instance from being lit by a DirectionalLight3D and it doesn’t seem to be working, am I messing anything up?
Fixed
godotengine:3.2
← JFonS:fix_directional_disabling
opened 02:40PM - 05 Mar 21 UTC
**GLES3**
This commit makes it possible to disable 3D directional lights by u… sing the light's cull mask. It also automatically disables directionals when the object has baked lighting and the light is set to "bake all".
While these changes work fine, they have some downsides due to the current structure of the GLES3 renderer:
- Object sorting is done only once for all directional lights, so there is no way to sort the enabled/disabled objects for each light.
This results in more GL state changes and can have some performance hit (only happens if directional lights affect some objects and not others).
- Environment lighting is always done in the first pass, regardless of the corresponding directional light being enabled or not.
This means in some cases there will be a first pass with env light only (disabled light) and a second pass with an enabled light only, instead of merging the two passes in a single one.
**GLES2**
Added a check for the light cull mask, since it was previously ignored.
Fixes #46332. Fixes #19438.
Edit: Might only be useful for the older render engine though, not quite sure
1 Like