mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Replace the term "color space" with "color encoding". Add additional detail to Color class description. State clearly that Color is expected to use the nonlinear sRGB transfer function.
This commit is contained in:
committed by
Allen Pestaluky
parent
fcd1cf8d57
commit
46e40969a2
@@ -41,7 +41,7 @@
|
||||
[/codeblock]
|
||||
</constant>
|
||||
<constant name="FUNC_LINEAR_TO_SRGB" value="4" enum="Function">
|
||||
Converts color from linear color space to sRGB color space using the following formula:
|
||||
Converts color from linear encoding to nonlinear sRGB encoding using the following formula:
|
||||
[codeblock]
|
||||
vec3 c = clamp(c, vec3(0.0), vec3(1.0));
|
||||
const vec3 a = vec3(0.055f);
|
||||
@@ -54,7 +54,7 @@
|
||||
[/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:
|
||||
Converts color from nonlinear sRGB encoding to linear encoding 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)));
|
||||
|
||||
Reference in New Issue
Block a user