summaryrefslogtreecommitdiffstats
path: root/doc/classes/VisualShaderNodeColorFunc.xml
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-26 19:30:58 +0000
committerGitHub <noreply@github.com>2024-11-26 19:30:58 +0000
commitb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (patch)
tree79c2a4c34f2d888ff962d76edf474c518d1abdea /doc/classes/VisualShaderNodeColorFunc.xml
parentc5b1645e60a59c0292c04bece3fdb0715a61afea (diff)
parente58e18261ea7ed3978146ef8d77a900be2601be3 (diff)
downloadredot-engine-b06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e.tar.gz
Merge pull request #885 from Spartan322/merge/d09d82d
Merge commit godotengine/godot@d09d82d
Diffstat (limited to 'doc/classes/VisualShaderNodeColorFunc.xml')
-rw-r--r--doc/classes/VisualShaderNodeColorFunc.xml27
1 files changed, 26 insertions, 1 deletions
diff --git a/doc/classes/VisualShaderNodeColorFunc.xml b/doc/classes/VisualShaderNodeColorFunc.xml
index edb5238325..aa2dcca1d5 100644
--- a/doc/classes/VisualShaderNodeColorFunc.xml
+++ b/doc/classes/VisualShaderNodeColorFunc.xml
@@ -40,7 +40,32 @@
return vec3(r, g, b);
[/codeblock]
</constant>
- <constant name="FUNC_MAX" value="4" enum="Function">
+ <constant name="FUNC_LINEAR_TO_SRGB" value="4" enum="Function">
+ Converts color from linear color space to sRGB color space using the following formula:
+ [codeblock]
+ vec3 c = clamp(c, vec3(0.0), vec3(1.0));
+ const vec3 a = vec3(0.055f);
+ return mix((vec3(1.0f) + a) * pow(c.rgb, vec3(1.0f / 2.4f)) - a, 12.92f * c.rgb, lessThan(c.rgb, vec3(0.0031308f)));
+ [/codeblock]
+ The Compatibility renderer uses a simpler formula:
+ [codeblock]
+ vec3 c = input;
+ return max(vec3(1.055) * pow(c, vec3(0.416666667)) - vec3(0.055), vec3(0.0));
+ [/codeblock]
+ </constant>
+ <constant name="FUNC_SRGB_TO_LINEAR" value="5" enum="Function">
+ Converts color from sRGB color space to linear color space using the following formula:
+ [codeblock]
+ vec3 c = input;
+ return mix(pow((c.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), c.rgb * (1.0 / 12.92), lessThan(c.rgb, vec3(0.04045)));
+ [/codeblock]
+ The Compatibility renderer uses a simpler formula:
+ [codeblock]
+ vec3 c = input;
+ return c * (c * (c * 0.305306011 + 0.682171111) + 0.012522878);
+ [/codeblock]
+ </constant>
+ <constant name="FUNC_MAX" value="6" enum="Function">
Represents the size of the [enum Function] enum.
</constant>
</constants>