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

Fallback to linear color texture when using 2D HDR and MSDF font #80651

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

clayjohn
Copy link
Member

Fixes: #80646

The issue here came from the fact that, when using HDR rendering, Godot uses the "srgb" variant of the color texture. The srgb-variant ensures that the GPU does an srgb->linear conversion when the texture is read in the shader.

This causes problems when we use the color texture to pass in a texture that does not contain colors (like with MSDF textures). When a texture does not contain colors, we should not do any color space conversions at all.

This PR introduces a flag that can be used to ensure that the normal (non-srgb) texture variant is used.

No need to cherrypick as this relates to a new feature

@clayjohn clayjohn added this to the 4.2 milestone Aug 15, 2023
@clayjohn clayjohn requested a review from a team as a code owner August 15, 2023 09:12
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Rationale and code make sense.

@akien-mga akien-mga merged commit 623156a into godotengine:master Aug 16, 2023
16 checks passed
@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.

2d hdr + font msdf causes broken text rendering
2 participants