text-imgui.vp 981 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. // Attributes
  13. layout(location = 0) in vec3 in_vertex;
  14. layout(location = 1) in vec3 in_color;
  15. layout(location = 2) in vec2 in_uv;
  16. //layout(location = 3) in vec3 in_normal;
  17. // Uniforms
  18. uniform vec3 position = vec3(0.0,0.0,0.0); // Position in NDC space
  19. uniform float scale = 1.0;
  20. uniform vec2 viewport = vec2(1.0);
  21. uniform bool forceOpacity = true;
  22. out INTERFACE {
  23. vec4 col;
  24. vec2 uv;
  25. } Out ;
  26. void main(){
  27. // Should be in -1,1
  28. // Multiply by the w component to stay at a constant screen size.
  29. gl_Position = vec4(position.xy+scale*in_vertex.xy/viewport, 0.0, 1.0);
  30. Out.uv = in_uv;
  31. Out.col = vec4(in_color, forceOpacity ? 1.0 : in_vertex.z);
  32. }