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

Use lower shadow blur for distant directional shadow splits #2729

Closed
Calinou opened this issue May 15, 2021 · 0 comments · Fixed by godotengine/godot#48776
Closed

Use lower shadow blur for distant directional shadow splits #2729

Calinou opened this issue May 15, 2021 · 0 comments · Fixed by godotengine/godot#48776

Comments

@Calinou
Copy link
Member

Calinou commented May 15, 2021

Related to #3908.

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

The new Vulkan renderer allows customizing shadow blur on a per-light basis. This works on directional lights too, but the blur far is currently global and applies in the same way to all PSSM splits.
(This is not a problem when using the Orthogonal shadow rendering mode, but this mode has the lowest quality since it only uses a single split.)

Shadow blur allows for lights to look smoother and more stable when moving objects are casting shadows. The downside is that at higher blur values, the transition between splits becomes more and more noticeable. This is with Blur set to 1.5 (the default is 1.0):

a

It's possible to hide this transition by enabling Blend Splits on the DirectionalLight3D, but this has a significant performance cost.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Use a lower blur value for distant directional shadow splits, and keep the current blur value for the closest split.

This would make the transition much less noticeable. It wouldn't be perfect like with Blend Splits, but this lower shadow blur for distant splits would have (almost) no performance cost. In fact, this can also be combined with Blend Splits enabled to prevent shadows from lacking detail in the distance.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I'm not sure if this is technically possible, so the feasibility of this has to be investigated first.

Edit I managed to implement it: godotengine/godot#48776

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as this is core renderer functionality.

Is there a reason why this should be core and not an add-on in the asset library?

This is core renderer functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant