zcopy.frag.0.glsl100es 725 B

123456789101112131415161718192021222324252627
  1. #version 100
  2. precision mediump float;
  3. precision highp int;
  4. uniform mediump sampler2D tex;
  5. varying highp vec2 vUV;
  6. vec3 sRGBtoRGB(vec3 rgb)
  7. {
  8. bvec3 cutoff = greaterThanEqual(rgb, vec3(0.040449999272823333740234375));
  9. vec3 below = rgb / vec3(12.9200000762939453125);
  10. vec3 above = pow((rgb + vec3(0.054999999701976776123046875)) / vec3(1.05499994754791259765625), vec3(2.400000095367431640625));
  11. return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
  12. }
  13. void main()
  14. {
  15. vec4 texel = texture2D(tex, vUV);
  16. vec3 param = texel.xyz;
  17. vec3 _59 = sRGBtoRGB(param);
  18. texel.x = _59.x;
  19. texel.y = _59.y;
  20. texel.z = _59.z;
  21. gl_FragData[0] = texel;
  22. }