SunVS.js 876 B

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