You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
570 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. attribute vec3 pos;
  2. attribute vec2 texcoord;
  3. attribute vec3 normal;
  4. uniform mat4 M;
  5. uniform mat4 P;
  6. uniform mat4 V;
  7. uniform mat4 U_ProjectorMatrix;
  8. uniform mat4 U_ProjectorNoTransScaleMatrix;
  9. varying vec2 V_Texcoord;
  10. varying vec3 V_WorldPos;
  11. varying vec4 V_ProjectCoord;
  12. varying vec4 V_ProjectorSpaceFragPos;
  13. void main()
  14. {
  15. V_Texcoord = texcoord;
  16. vec4 worldPos = M * vec4(pos, 1.0);
  17. V_WorldPos = worldPos.xyz;
  18. V_ProjectCoord = U_ProjectorMatrix * worldPos;
  19. V_ProjectorSpaceFragPos = U_ProjectorNoTransScaleMatrix * worldPos;
  20. gl_Position=P*V*M*vec4(pos,1.0);
  21. }