topview.fp 835 B

12345678910111213141516171819202122232425262728293031
  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. /**
  12. * \file topview.fp
  13. *
  14. * Basic shader to render textured/colored geometry
  15. */
  16. #version 420
  17. layout(binding = 0) uniform sampler2D tex;/**< Input texture */
  18. layout(location= 0) out vec4 out_color; /**< Output texture map */
  19. uniform vec4 in_color; /**< Uniform color */
  20. in vec4 texcoord; /**< Texture coords at current pixel */
  21. void main(void) {
  22. vec4 c1 = texture(tex,texcoord.xy);
  23. vec4 c2 = in_color;
  24. out_color = c2.a*in_color + clamp(1.0-c2.a,0.0,1.0)*c1;
  25. }