displace.vert 503 B

1234567891011121314151617181920212223
  1. uniform mat4 ModelMatrix;
  2. #if __VERSION__ >= 330
  3. layout(location = 0) in vec3 Position;
  4. layout(location = 3) in vec2 Texcoord;
  5. layout(location = 4) in vec2 SecondTexcoord;
  6. #else
  7. in vec3 Position;
  8. in vec2 Texcoord;
  9. in vec2 SecondTexcoord;
  10. #endif
  11. out vec2 uv;
  12. out vec2 uv_bis;
  13. out float camdist;
  14. void main() {
  15. gl_Position = ProjectionMatrix * ViewMatrix * ModelMatrix * vec4(Position, 1.);
  16. uv = Texcoord;
  17. uv_bis = SecondTexcoord;
  18. camdist = length(ViewMatrix * ModelMatrix * vec4(Position, 1.));
  19. }