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

Fix compatibility renderer depth_prepass_alpha #93931

Merged

Conversation

Khasehemwy
Copy link
Contributor

@Khasehemwy Khasehemwy commented Jul 4, 2024

In compatibility mode, when using render_mode depth_prepass_alpha; in Shader, the depth pre pass is not work.

I tested minimal project in Forward+ mode, Nsight showed that a depth pre pass was performed. But I didn't see it in compatibility mode. So I modified the OpenGL part according to the code like render_forward_clustered.

Minimum test project:
test_depth_prepass_alpha_compatibility.zip

@Khasehemwy Khasehemwy requested a review from a team as a code owner July 4, 2024 09:55
@AThousandShips AThousandShips changed the title fix depth_prepass_alpha not work in compatibility mode Fix compatibility renderer depth_prepass_alpha Jul 4, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone Jul 4, 2024
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

This looks great. Thank you.

For context this is the same behaviour as the Forward+ Renderer, the Mobile renderer is different because it doesn't do a depth prepass.

This adds alpha prepass objects to both render lists, but the render_list_template function ensures that alpha-prepass objects are not drawn in the forward pass

if (p_pass_mode == PASS_MODE_COLOR && !(surf->flags & GeometryInstanceSurface::FLAG_PASS_OPAQUE)) {
continue; // Objects with "Depth-prepass" transparency are included in both render lists, but should only be rendered in the transparent pass
}

@akien-mga akien-mga changed the title Fix compatibility renderer depth_prepass_alpha Fix compatibility renderer depth_prepass_alpha Jul 20, 2024
@akien-mga akien-mga merged commit 6621d8e into godotengine:master Jul 20, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@Khasehemwy Khasehemwy deleted the fix-compatibility-depth_prepass_alpha branch July 22, 2024 02:18
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.

4 participants