stereoscopic.glsl 647 B

1234567891011121314151617181920212223242526272829303132
  1. // Omega's 3D Stereoscopic filtering
  2. // TODO: Need depth info!
  3. uniform sampler2D samp9;
  4. out vec4 ocol0;
  5. in vec2 uv0;
  6. uniform vec4 resolution;
  7. void main()
  8. {
  9. float4 c0 = texture(samp9, uv0).rgba; // Source Color
  10. float sep = 5;
  11. float red = c0.r;
  12. float green = c0.g;
  13. float blue = c0.b;
  14. // Left Eye (Red)
  15. float4 c1 = texture(samp9, uv0 + float2(sep,0)*resolution.zw).rgba;
  16. red = max(c0.r, c1.r);
  17. // Right Eye (Cyan)
  18. float4 c2 = texture(samp9, uv0 + float2(-sep,0)*resolution.zw).rgba;
  19. float cyan = (c2.g + c2.b) / 2;
  20. green = max(c0.g, cyan);
  21. blue = max(c0.b, cyan);
  22. ocol0 = float4(red, green, blue, c0.a);
  23. }