anaglyph.fp 683 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (C) 2020, Inria
  3. * GRAPHDECO research group, https://team.inria.fr/graphdeco
  4. * All rights reserved.
  5. *
  6. * This software is free for non-commercial, research and evaluation use
  7. * under the terms of the LICENSE.md file.
  8. *
  9. * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr
  10. */
  11. #version 420
  12. layout(binding = 0) uniform sampler2D left;
  13. layout(binding = 1) uniform sampler2D right;
  14. layout(location= 0) out vec4 out_color;
  15. in vec2 vertex_coord;
  16. void main(void) {
  17. vec2 texcoord = (vertex_coord + vec2(1.0)) / 2.0;
  18. vec4 cl = texture(left, texcoord);
  19. vec4 cr = texture(right, texcoord);
  20. out_color = vec4(cl.r, cr.g, cr.b, 1.0);
  21. }