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

Re-implement the PSSM_SPLITS debug option #76565

Merged
merged 1 commit into from
May 15, 2023

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Apr 28, 2023

This uses a render_mode instead of shadow_color to avoid adding a cost to the basic shader

I am not sure this is the optimal way to implement this, but I am uploading for now to help debug work in #76291

We should discuss if render_mode is the right way to implement this. Right now it is the only feasible option that doesn't require either:

  1. exposing light splits to user shaders
  2. a new way of adding single defines into shaders

But we may want to implement an API for creating debug modes of shaders

image

A simple alternative that I have seen is to run a full screen pass that reads from the depth buffer and tints everything based on distance. This wouldn't be limited just to shadows, but it would outline the cascades just as effectively and be an even simpler, more self-contained implementation

@clayjohn clayjohn added this to the 4.x milestone Apr 28, 2023
@clayjohn clayjohn requested a review from BastiaanOlij April 28, 2023 23:05
@clayjohn clayjohn requested a review from a team as a code owner April 28, 2023 23:05
This uses a render_mode instead of shadow_color to avoid adding a cost to the basic shader
@clayjohn clayjohn force-pushed the debug-PSSM-splits branch from f9fc6c4 to ca23d06 Compare April 29, 2023 00:54
Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame this doesn't work for custom materials where we change the vertex position and it would be nice if we think of a solution for this, but just what this adds right now is already a big improvement.

@akien-mga akien-mga modified the milestones: 4.x, 4.1 May 15, 2023
@akien-mga akien-mga merged commit 9ecb929 into godotengine:master May 15, 2023
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants