-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
unshaded mesh is brighter than albedo set in fragment shader with vulkan renderer #70797
Comments
I just found out that this does not seem to be related to textures: setting the albedo to |
This is likely a sRGB-to-linear conversion issue. You can fix this by adding |
Yes, adding that fixed the difference in color |
When setting the albedo without a texture there is still a difference in color.
Is this something that can be fixed? Or should it be documented and accepted? (for me it was not yet clear from the documentation that this could happen) used shader:
Minimal reproduction project: |
This isn't a bug, you are just forgetting the In the second MRP you are setting the quads to two different colors. The quad on the left is in sRGB space while the quad on the right is in linear space. |
I hope it's okay to add something here because this issue was a top search result while debugging a similar problem I had: Even with The reason was that Godot's viewport is set to the Filmic tonemap by default. It can be changed to Linear here: I know this is intended, but I figured adding a comment here might help people with the same problem in the future. |
I am from the future. Thank you. PS. If anyone is trying to use source_color (as mentioned above) in the VisualShader editor, make sure to go to your Texture2D node dropdown where it says "Data" and change it to "Color". |
Godot version
v4.0.beta10.official.d0398f62f
System information
archlinux; vulkan on dedicated
NVIDIA GeForce RTX 3060 Laptop GPU
; opengl3 on integratedAMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.49, 6.1.1-arch1-1)
Issue description
When using the fragment shader to set an albedo then the color that is rendered much too bright, even when the mesh is unshaded.
This happens with the vulkan renderer, but it does not seem to happen with the opengl3 renderer.
With vulkan renderer :
With the opengl3 renderer this does not occur:
(The lack of interpolation seems to be a different problem)
Used texture:
Shader:
This example uses the render mode
unshaded
for simplicity, but when lightning calculations do occur then this shader still shows a brighter color than expectedSteps to reproduce
View a mesh that uses the shader above and is given a texture as parameter in a project with the vulkan renderer
Minimal reproduction project
texturebrightness.zip
The text was updated successfully, but these errors were encountered: