dubois-LCD-Green-Magenta.glsl 637 B

123456789101112131415161718192021
  1. // Anaglyph Green-Magenta shader based on Dubois algorithm
  2. // Constants taken from the screenshot:
  3. // "https://www.flickr.com/photos/e_dubois/5132528166/"
  4. // Eric Dubois
  5. void main()
  6. {
  7. float4 c0 = SampleLayer(0);
  8. float4 c1 = SampleLayer(1);
  9. float3 lr = float3(-0.062,-0.158,-0.039);
  10. float3 lg = float3( 0.284, 0.668, 0.143);
  11. float3 lb = float3(-0.015,-0.027, 0.021);
  12. float3 rr = float3( 0.529, 0.705, 0.024);
  13. float3 rg = float3(-0.016,-0.015, 0.065);
  14. float3 rb = float3( 0.009, 0.075, 0.937);
  15. SetOutput(float4(dot(lr, c0.rgb) + dot(rr, c1.rgb), dot(lg, c0.rgb) + dot(rg, c1.rgb), dot(lb, c0.rgb) + dot(rb, c1.rgb), c0.a));
  16. }