SunVS.js 696 B

1234567891011121314151617181920212223
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "attribute vec2 direction;\n\
  3. uniform float u_size;\n\
  4. varying vec2 v_textureCoordinates;\n\
  5. void main()\n\
  6. {\n\
  7. vec4 position;\n\
  8. if (czm_morphTime == 1.0)\n\
  9. {\n\
  10. position = vec4(czm_sunPositionWC, 1.0);\n\
  11. }\n\
  12. else\n\
  13. {\n\
  14. position = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n\
  15. }\n\
  16. vec4 positionEC = czm_view * position;\n\
  17. vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n\
  18. vec2 halfSize = vec2(u_size * 0.5);\n\
  19. halfSize *= ((direction * 2.0) - 1.0);\n\
  20. gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\n\
  21. v_textureCoordinates = direction;\n\
  22. }\n\
  23. ";