-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Implement DirectionalLight3D cull masks in Compatibility #107384
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
base: master
Are you sure you want to change the base?
Implement DirectionalLight3D cull masks in Compatibility #107384
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.
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. |
This allows for using cull masks with
DirectionalLight3D
s 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