Implement DirectionalLight3D cull masks in Compatibility#107384
Implement DirectionalLight3D cull masks in Compatibility#107384Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
2067153 to
f14573b
Compare
f14573b to
90e8534
Compare
Lights with shadows enabled in Compatibility are rendered in a separate pass, as described in Internal rendering architecture. |
90e8534 to
1e7ae93
Compare
22328dd to
1585c42
Compare
There was a problem hiding this comment.
Tested locally, it mostly works as expected (both with shadows enabled and disabled).
Testing project: test_pr_107384.zip
Preview
| Forward+ | Mobile | Compatibility |
|---|---|---|
![]() |
![]() |
![]() |
One issue I encountered while testing is that I've had a situation where it looked like this in Compatibility (each screenshot taken in a different session):
![]() |
![]() |
|---|---|
![]() |
![]() |
It seems to sporadically occur on startup, and is possibly due to uninitialized memory somewhere (which leads to undefined behavior). I've also had one situation where it appeared to render correctly, but part of the sky was pure black. This doesn't occur on master.
A quick way to test is to use Debug > Customize Run Instances..., enable multiple instances and increase the instance count to a value your PC can handle (up to 20).
1585c42 to
0c88c44
Compare
|
@Calinou I'm unable to reproduce this (maybe different graphics driver?), but I have a guess as to why it was doing that and have just pushed what is hopefully the fix. |
Calinou
left a comment
There was a problem hiding this comment.
The issue I reported above appears to be fixed now (tested over 20 launches in Compatibility).
0c88c44 to
a8bd26d
Compare
|
@BossMaink Should be fixed now, I forgot to send in the layer mask for the transparent pass so it was always 0. |
|
@Kaleb-Reid You’re the best, issue be fixed now |
a8bd26d to
b653636
Compare
|
Rebased onto master |
b653636 to
79b1a6d
Compare
|
Thanks! |
|
@dog-on-moon You should make an issue for this. Also put in the issue if the light has shadows enabled. |
|
I did more testing with it and found out that it wasn't related to this PR, but rather just that multiple directional lights break shaders in very specific circumstances that I can't quite figure out. If I can figure out an MRP I'll report it as an issue, but right now the actual conditions seem really niche and related to specific things in my project that I can't seem to isolate; apologies for the scare :P |
|
OK, teammate figured it out, figured I'd link it here anyways: #112216 |

















This allows for using cull masks with
DirectionalLight3Ds in the Compatibility renderer.I'm mostly certain that they were not implemented before, I spent a bit of time looking for why they stopped working but I think it's because they never did.
I'm not sure what the optimal way is or if I'm missing anything so I encourage feedback.
Fixes #103595