-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
VisualShader: Add LinearToSRGB and SRGBToLinear to ColorFunc node #97388
VisualShader: Add LinearToSRGB and SRGBToLinear to ColorFunc node #97388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, I wanted to suggest switching the computation based on the current renderer, but after looking at the referenced blog article, I think it would be fine to just use the compatibility version (since it's a very good approximation). Maybe it can be used for RD renderers as well. CC @clayjohn
All else being equal, the visual shader node should be accurate to whatever computation is used in the current renderer (or, if it must make assumptions, favor the Forward+ and Mobile renderers). |
4c382df
to
22b86ee
Compare
The computation now depends on the renderer, exactly matching whichever computation is used internally. |
22b86ee
to
2191df0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming accuracy, the docs are completely fine.
Thanks! |
Implements and closes godotengine/godot-proposals#10818.
Adds LinearToSRGB and SRGBToLinear conversions to the visual shader node
ColorFunc
.Implementation:
This node automatically switches it's conversion function depending on which renderer is used.
The RenderingDevice (Forward+ and Mobile Renderer) conversion functions:
godot/servers/rendering/renderer_rd/shaders/effects/copy_to_fb.glsl
Lines 121 to 130 in 4254946
The Compatibility renderer uses slightly different functions:
godot/drivers/gles3/shaders/tonemap_inc.glsl
Lines 13 to 26 in 4254946
If #90187 is merged, and the change in that PR is also made to the GLSL version of the
linear_to_srgb
andsrgb_to_linear
functions, then this visual shader node will need to be updated.