PolylineMaterialAppearanceVS.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "in vec3 position3DHigh;\n\
  3. in vec3 position3DLow;\n\
  4. in vec3 prevPosition3DHigh;\n\
  5. in vec3 prevPosition3DLow;\n\
  6. in vec3 nextPosition3DHigh;\n\
  7. in vec3 nextPosition3DLow;\n\
  8. in vec2 expandAndWidth;\n\
  9. in vec2 st;\n\
  10. in float batchId;\n\
  11. \n\
  12. out float v_width;\n\
  13. out vec2 v_st;\n\
  14. out float v_polylineAngle;\n\
  15. \n\
  16. void main()\n\
  17. {\n\
  18. float expandDir = expandAndWidth.x;\n\
  19. float width = abs(expandAndWidth.y) + 0.5;\n\
  20. bool usePrev = expandAndWidth.y < 0.0;\n\
  21. \n\
  22. vec4 p = czm_computePosition();\n\
  23. vec4 prev = czm_computePrevPosition();\n\
  24. vec4 next = czm_computeNextPosition();\n\
  25. \n\
  26. float angle;\n\
  27. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n\
  28. gl_Position = czm_viewportOrthographic * positionWC;\n\
  29. \n\
  30. v_width = width;\n\
  31. v_st.s = st.s;\n\
  32. v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\n\
  33. v_polylineAngle = angle;\n\
  34. }\n\
  35. ";