textured_mesh.frag 609 B

123456789101112131415161718192021222324252627282930
  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. uniform sampler2D tex;
  13. out vec4 out_color;
  14. in vec2 vertUV;
  15. void main(void) {
  16. vec2 uv = vertUV;
  17. if(uv.x==0.0 && uv.y==0.0){
  18. out_color = vec4(1.0,1.0,1.0,1.0);
  19. }
  20. else{
  21. uv.y = 1.0 - uv.y; /// \todo TODO: Why Texture are flipped in y ?
  22. out_color = texture(tex, uv);
  23. }
  24. }