sky.vertex.fx 805 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. precision highp float;
  2. // Attributes
  3. attribute vec3 position;
  4. #ifdef VERTEXCOLOR
  5. attribute vec4 color;
  6. #endif
  7. // Uniforms
  8. uniform mat4 world;
  9. uniform mat4 view;
  10. uniform mat4 viewProjection;
  11. #ifdef POINTSIZE
  12. uniform float pointSize;
  13. #endif
  14. // Output
  15. varying vec3 vPositionW;
  16. #ifdef VERTEXCOLOR
  17. varying vec4 vColor;
  18. #endif
  19. #include<clipPlaneVertexDeclaration>
  20. #include<fogVertexDeclaration>
  21. void main(void) {
  22. gl_Position = viewProjection * world * vec4(position, 1.0);
  23. vec4 worldPos = world * vec4(position, 1.0);
  24. vPositionW = vec3(worldPos);
  25. // Clip plane
  26. #include<clipPlaneVertex>
  27. // Fog
  28. #include<fogVertex>
  29. // Vertex color
  30. #ifdef VERTEXCOLOR
  31. vColor = color;
  32. #endif
  33. // Point size
  34. #ifdef POINTSIZE
  35. gl_PointSize = pointSize;
  36. #endif
  37. }