parent
a9a49f19ca
commit
e417fac52e
4 changed files with 5 additions and 8 deletions
|
@ -1,5 +1,3 @@
|
||||||
#version 100 es
|
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform sampler2D u_sampler;
|
uniform sampler2D u_sampler;
|
||||||
varying vec4 v_rgba;
|
varying vec4 v_rgba;
|
||||||
|
@ -13,6 +11,7 @@ vec3 srgb_from_linear(vec3 rgb) {
|
||||||
return mix(higher, lower, vec3(cutoff));
|
return mix(higher, lower, vec3(cutoff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0-255 sRGB from 0-1 linear
|
||||||
vec4 srgba_from_linear(vec4 rgba) {
|
vec4 srgba_from_linear(vec4 rgba) {
|
||||||
return vec4(srgb_from_linear(rgba.rgb), 255.0 * rgba.a);
|
return vec4(srgb_from_linear(rgba.rgb), 255.0 * rgba.a);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +24,7 @@ vec3 linear_from_srgb(vec3 srgb) {
|
||||||
return mix(higher, lower, vec3(cutoff));
|
return mix(higher, lower, vec3(cutoff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0-1 linear from 0-255 sRGBA
|
||||||
vec4 linear_from_srgba(vec4 srgba) {
|
vec4 linear_from_srgba(vec4 srgba) {
|
||||||
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#version 300 es
|
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform sampler2D u_sampler;
|
uniform sampler2D u_sampler;
|
||||||
varying vec4 v_rgba;
|
varying vec4 v_rgba;
|
||||||
|
@ -13,6 +11,7 @@ vec3 srgb_from_linear(vec3 rgb) {
|
||||||
return mix(higher, lower, vec3(cutoff));
|
return mix(higher, lower, vec3(cutoff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0-255 sRGBA from 0-1 linear
|
||||||
vec4 srgba_from_linear(vec4 rgba) {
|
vec4 srgba_from_linear(vec4 rgba) {
|
||||||
return vec4(srgb_from_linear(rgba.rgb), 255.0 * rgba.a);
|
return vec4(srgb_from_linear(rgba.rgb), 255.0 * rgba.a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#version 100 es
|
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform vec2 u_screen_size;
|
uniform vec2 u_screen_size;
|
||||||
attribute vec2 a_pos;
|
attribute vec2 a_pos;
|
||||||
|
@ -16,6 +14,7 @@ vec3 linear_from_srgb(vec3 srgb) {
|
||||||
return mix(higher, lower, vec3(cutoff));
|
return mix(higher, lower, vec3(cutoff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0-1 linear from 0-255 sRGBA
|
||||||
vec4 linear_from_srgba(vec4 srgba) {
|
vec4 linear_from_srgba(vec4 srgba) {
|
||||||
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#version 300 es
|
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform vec2 u_screen_size;
|
uniform vec2 u_screen_size;
|
||||||
attribute vec2 a_pos;
|
attribute vec2 a_pos;
|
||||||
|
@ -16,6 +14,7 @@ vec3 linear_from_srgb(vec3 srgb) {
|
||||||
return mix(higher, lower, vec3(cutoff));
|
return mix(higher, lower, vec3(cutoff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0-1 linear from 0-255 sRGBA
|
||||||
vec4 linear_from_srgba(vec4 srgba) {
|
vec4 linear_from_srgba(vec4 srgba) {
|
||||||
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
return vec4(linear_from_srgb(srgba.rgb), srgba.a / 255.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue