Skip to content

Compatibility: Fix backface culling gets ignored when double-sided shadows are used#109793

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
joaopedroxavier:double-sided-shadows-no-culling
Sep 16, 2025
Merged

Compatibility: Fix backface culling gets ignored when double-sided shadows are used#109793
Repiteo merged 1 commit into
godotengine:masterfrom
joaopedroxavier:double-sided-shadows-no-culling

Conversation

@joaopedroxavier

Copy link
Copy Markdown
Contributor

Fixes #108941. Looks like the culling mode was always disabled (no matter the render pass) if the material is setup with double-sided shadows:

if (p_pass_mode == PASS_MODE_MATERIAL || (surf->flags & GeometryInstanceSurface::FLAG_USES_DOUBLE_SIDED_SHADOWS)) {
				cull_mode = RS::CULL_MODE_DISABLED;
}

Looks fixed after adjusting the condition check.

Image Image

@joaopedroxavier joaopedroxavier requested a review from a team as a code owner August 20, 2025 03:25
@AThousandShips AThousandShips added bug topic:rendering topic:3d cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Aug 20, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Aug 20, 2025
@AThousandShips AThousandShips changed the title Compatibility: Fix bug where backface culling gets ignored when double-sided shadows are used Compatibility: Fix backface culling gets ignored when double-sided shadows are used Aug 20, 2025

@clayjohn clayjohn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! Thank you

@Calinou Calinou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested locally, it works as expected. Code looks good to me.

@Repiteo Repiteo merged commit 697474b into godotengine:master Sep 16, 2025
20 checks passed
@Repiteo

Repiteo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Thanks! Congratulations on your first merged contribuition! 🎉

@Repiteo

Repiteo commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Cherry-picked to 4.5

@Repiteo Repiteo removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 30, 2025
@Repiteo

Repiteo commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Cherry-picked to 4.4

@Repiteo Repiteo removed the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Sep 30, 2025
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.

Double-sided shadow casting mode causes MeshInstance3Ds to render without backface culling in the Compatibility renderer

6 participants