SunVS.js 798 B

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