positionReflectedDirRenderer.frag 592 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. in vec3 position;
  13. in vec3 normal;
  14. uniform vec3 cameraPos;
  15. layout(location = 0) out vec3 outPosition;
  16. layout(location = 1) out vec3 outDirection;
  17. void main(void) {
  18. outPosition = position;
  19. outDirection = reflect(normalize(position - cameraPos), normal);
  20. }