mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
Directly operate on vec3 for linear2srgb
This commit is contained in:
parent
0307ae061e
commit
6c44eadf77
1 changed files with 4 additions and 2 deletions
|
|
@ -14,8 +14,10 @@ float linear2srgb(float x) {
|
|||
return mix(lower, upper, step(0.0031308f, x));
|
||||
}
|
||||
|
||||
vec3 linear2srgb(vec3 c) {
|
||||
return vec3(linear2srgb(c.r), linear2srgb(c.g), linear2srgb(c.b));
|
||||
vec3 linear2srgb(vec3 x) {
|
||||
vec3 lower = 12.92 * x;
|
||||
vec3 upper = 1.055 * pow(x, vec3(1.0f / 2.4f)) - 0.055f;
|
||||
return mix(lower, upper, step(0.0031308f, x));
|
||||
}
|
||||
|
||||
vec3 srgb2linear(vec3 c) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue