-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Using set_shader_param with a color returns non-linear colors #28504
Comments
What does it look like on the shader side? Are you using |
Shader:
I have not tried |
Its because you are using a color. It looks like the engine is converting to sRGB for you because you are passing in a color instead of a vector. The problem goes away if you use a vector. |
If I were to pass in a As for |
Sampler2D won't have this problem as it is imported as linear by default unless you use |
As a workaround, is this allowed in the shader language? I haven't tried. ALBEDO = vec3(abs(param.x - UV.x) * 10.0);
ALBEDO.a = 0.5; |
If I'm not mistaken, wouldn't this just make the mesh transparent? (If it had that flag enabled) |
As a workaround, you can convert all your data using this algorithm: Updated Test Project Neither "hint_color" nor "hint_albedo" fix the issue. Also, samplers do encounter this issue |
Godot version: v3.1.stable.mono.official (LATEST)
OS/device including version: Ubuntu 18.04 bionic,
Kernel: x86_64 Linux 4.18.0-17-generic
Issue description:
If using colors to transfer values (Since sampler2d is our only array), The values seem to be offset by 0.05 and put through a square root function
If the red value is set to
sqrt(0.55)
, the line seems to appear in the middleSteps to reproduce:
set_shader_param('param_name', Color(0.5, 1.0, 1.0))
to set a specific colorMinimal reproduction project:
GodotTestProject.zip
The text was updated successfully, but these errors were encountered: