Skip to content
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

Shadow cascades can be cross-blended using dithering #7233

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 23, 2024

Feature

Directional light shadow cascades can be cross blended using dithering, instead of being a hard line switch. This looks relatively fine with textured objects, but it is an improvement even without it, where dithering is more obvious.

new public API:

LightComponent.cascadeBlend - value between 0 and 1, defaults to 0

without dithering:
Screenshot 2024-12-23 at 14 44 57

with dithering:
Screenshot 2024-12-23 at 14 41 47

In the future we can further improve this. When TAA is enabled, we can use moving blue noise to have per frame randomized dithering, which TAA would renoise. Added here

Fixes

Fixes to issues where additional / incorrect shaders were being compiled when changing light properties:

  • internally shader generation options clone lights, and those lights were invalidating layers and generating new shaders. Now layer is invalidated only by a light assigned to it.
  • normalOffsetBias has updating the key before modifying the value, so the keys were not correct, and would cause another shader generation of the next property update.

@mvaligursky mvaligursky merged commit 4e8b066 into main Dec 23, 2024
8 checks passed
@mvaligursky mvaligursky deleted the mv-cascade-blend branch December 23, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants