GlobeFSPole.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. //This file is automatically rebuilt by the Cesium build process.
  2. /*global define*/
  3. define(function() {
  4. "use strict";
  5. return "uniform vec3 u_color;\n\
  6. \n\
  7. varying vec2 v_textureCoordinates;\n\
  8. \n\
  9. void main()\n\
  10. {\n\
  11. // TODO: make arbitrary ellipsoid\n\
  12. czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n\
  13. vec3 direction = normalize(czm_windowToEyeCoordinates(gl_FragCoord).xyz);\n\
  14. czm_ray ray = czm_ray(vec3(0.0), direction);\n\
  15. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\n\
  16. \n\
  17. if (!czm_isEmpty(intersection))\n\
  18. {\n\
  19. vec3 positionEC = czm_pointAlongRay(ray, intersection.start);\n\
  20. vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\n\
  21. \n\
  22. vec3 normalMC = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));\n\
  23. vec3 normalEC = normalize(czm_normal * normalMC);\n\
  24. \n\
  25. vec3 startDayColor = u_color;\n\
  26. \n\
  27. gl_FragColor = vec4(startDayColor, 1.0);\n\
  28. }\n\
  29. else\n\
  30. {\n\
  31. discard;\n\
  32. }\n\
  33. }";
  34. });