mesh_normal.fp 693 B

123456789101112131415161718192021222324252627
  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(location = 0) out vec4 out_color;
  13. in vec3 normal_coord;
  14. void main(void) {
  15. vec3 color = vec3(normalize(normal_coord));
  16. color = color * 0.5 + 0.5;
  17. out_color = vec4(color, 1.0);
  18. //out_color = vec4(dot(normal_coord, vec3(0.58,-0.58,0.08)));
  19. if (length(normal_coord) == 0.0) { // no normal present
  20. out_color = vec4(0.8);
  21. }
  22. }