emboss.glsl 543 B

123456789101112131415161718192021222324
  1. uniform sampler2D samp9;
  2. out vec4 ocol0;
  3. in vec2 uv0;
  4. uniform vec4 resolution;
  5. void main()
  6. {
  7. float4 c0 = texture(samp9, uv0).rgba;
  8. float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw).rgba;
  9. float y = (0.222 * c1.r) + (0.707 * c1.g) + (0.071 * c1.b);
  10. float y2 = ((0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b)) / 3;
  11. float red = c0.r;
  12. float green = c0.g;
  13. float blue = c0.b;
  14. float alpha = c0.a;
  15. red = y2 + (1 - y);
  16. green = y2 + (1 - y);
  17. blue = y2 + (1 - y);
  18. ocol0 = float4(red, green, blue, alpha);
  19. }