-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Global shader uniform color not equal to regular uniform color. #70927
Comments
This may end up being something that is a documented limitation. Right now, you hint to Godot what the source of the uniform is - in this case the source is a color. Godot then decides whether to convert it from sRGB to linear depending on the destination. Spatial shaders convert to linear as lighting happens in linear space. CanvasItem shaders don't convert to linear as 2D rendering happens in sRGB space. Global uniforms can be used in either, but they map onto the same uniform internally, so they have to be either sRGB or linear in both Spatial shaders and CanvasItem shaders. My preference would be for global uniforms to always convert to linear when |
The more exact formula is
|
This may be fixed now #101642 |
I don't think so. The global buffer is uploaded in a different function. See
|
I tested and the MRP still shows the issue in current |
Godot version
4.0.beta10
System information
Windows 10 Vulkan
Issue description
The shader global color (top left) is the same hex code as the shader uniform (bottom right). But If i create an unshaded sphere, and show the colors next to each other, the shader global color is slightly lighter than the shader uniform color.
I thought maybe it's because of my shader code, so I reduced it to as simple as possible.
Steps to reproduce
Create an empty project.
Add a new shader global color.
Create a new shader material.
Set rendermode to unshaded.
Set the ALBEDO to the shader global color
Create an exact replica of this shader, but set the albedo to a regular shader uniform color.
Make sure both colors have the exacts same hex code.
Minimal reproduction project
test2.zip
The text was updated successfully, but these errors were encountered: