diff options
Diffstat (limited to 'vendor/gioui.org/shader/gio/zmaterial.frag.0.glsl100es')
-rw-r--r-- | vendor/gioui.org/shader/gio/zmaterial.frag.0.glsl100es | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/gioui.org/shader/gio/zmaterial.frag.0.glsl100es b/vendor/gioui.org/shader/gio/zmaterial.frag.0.glsl100es new file mode 100644 index 0000000..f2f2a30 --- /dev/null +++ b/vendor/gioui.org/shader/gio/zmaterial.frag.0.glsl100es @@ -0,0 +1,37 @@ +#version 100 +precision mediump float; +precision highp int; + +struct Color +{ + float emulateSRGB; +}; + +uniform Color _color; + +uniform mediump sampler2D tex; + +varying highp vec2 vUV; + +vec3 RGBtosRGB(vec3 rgb) +{ + bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375)); + vec3 below = vec3(12.9200000762939453125) * rgb; + vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875); + return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z); +} + +void main() +{ + vec4 texel = texture2D(tex, vUV); + if (_color.emulateSRGB == 0.0) + { + vec3 param = texel.xyz; + vec3 _71 = RGBtosRGB(param); + texel.x = _71.x; + texel.y = _71.y; + texel.z = _71.z; + } + gl_FragData[0] = texel; +} + |