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

Clear color is lighter on mobile renderer #79931

Closed
ChibiDenDen opened this issue Jul 26, 2023 · 5 comments · Fixed by #80933
Closed

Clear color is lighter on mobile renderer #79931

ChibiDenDen opened this issue Jul 26, 2023 · 5 comments · Fixed by #80933

Comments

@ChibiDenDen
Copy link
Contributor

Godot version

4.1.1

System information

windows 11, mobile renderer

Issue description

On Mobile Vulkan renderer, the clear color is 50% lighter than expected

See steps to reproduce and Minimal reproduction project below.

The box and background have the same color on Forward+ and compatibility, but not on Mobile
happens also in runtime on exported project, not only in editor preview

Images of the same scene from
compatibility:
compatibility
Forward+:
forward
Mobile:
mobile

Steps to reproduce

  • add a CSGBox3D with "unshaded" shading, and albedo of #545454
  • add environment with Background = Custom color and color of #545454

Box and background are not the same color

Minimal reproduction project

bg_color.zip

@clayjohn
Copy link
Member

@ChibiDenDen
Copy link
Contributor Author

I think it has more to do with the _render_buffers_get_luminance_multiplierset to 2 in the mobile renderer here:

float RenderForwardMobile::_render_buffers_get_luminance_multiplier() {

adding a .darkened(0.5) at the end of this line fixed it for me:

c.push_back(clear_color.srgb_to_linear()); // our render buffer

not sure if its the correct solution, I would love to create a pull request if you say it sounds right to you

@AndrewShobbrook
Copy link
Contributor

Yeah it seems like they forgot to multiply the colours by 0.5 in this specific case (Comment in _render_buffers_get_luminance_multiplier says that it gets multiplied by 2 due to using a UNORM buffer and they just multiply by 0.5 when rendering)

@clayjohn
Copy link
Member

clayjohn commented Aug 8, 2023

I think it has more to do with the _render_buffers_get_luminance_multiplierset to 2 in the mobile renderer here:

float RenderForwardMobile::_render_buffers_get_luminance_multiplier() {

adding a .darkened(0.5) at the end of this line fixed it for me:

c.push_back(clear_color.srgb_to_linear()); // our render buffer

not sure if its the correct solution, I would love to create a pull request if you say it sounds right to you

Ya, that sounds right

@ywmaa
Copy link
Contributor

ywmaa commented Aug 14, 2023

I am having the same issue :

image

Screenshot from 2023-08-14 07-47-07

Screenshot from 2023-08-14 07-47-29

Screenshot from 2023-08-14 07-47-36

as you see a clear color is provided, still the actual color is brighter, and it messes my whole scene, so it makes it a totally different color than the forward plus

Scene in Vulkan Mobile :
image

Scene in Forward Plus :
image

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