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

Ensure that "detect 3D" is only called when using 3D shaders #78199

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

clayjohn
Copy link
Member

Fixes: #62087

In the RD backend p_use_linear_color wasn't being properly sent to update_textures leading it to treat every shader as a 3D shader. This caused two problems:

  1. Detect 3D was always called ("Detect 3D" is triggered for ShaderMaterial with shader_type canvas_item; #62087), and
  2. When using canvas_item shaders with source_color the texture was converted to srgb twice, leading to it looking bad

In the GLES3 backend we didn't even track if a material was 3D or not, so the plumbing had to be added.

Tagging for 4.1, but not 4.0 as this will introduce a slight behaviour change that users may already be working around.

@clayjohn clayjohn added this to the 4.1 milestone Jun 13, 2023
@clayjohn clayjohn requested a review from a team as a code owner June 13, 2023 20:23
@akien-mga akien-mga merged commit e0651ed into godotengine:master Jun 14, 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.

"Detect 3D" is triggered for ShaderMaterial with shader_type canvas_item;
2 participants