PolylineMaterialAppearanceVS.glsl 764 B

12345678910111213141516171819202122232425262728
  1. attribute vec3 position3DHigh;
  2. attribute vec3 position3DLow;
  3. attribute vec3 prevPosition3DHigh;
  4. attribute vec3 prevPosition3DLow;
  5. attribute vec3 nextPosition3DHigh;
  6. attribute vec3 nextPosition3DLow;
  7. attribute vec2 expandAndWidth;
  8. attribute vec2 st;
  9. varying float v_width;
  10. varying vec2 v_st;
  11. void main()
  12. {
  13. float expandDir = expandAndWidth.x;
  14. float width = abs(expandAndWidth.y) + 0.5;
  15. bool usePrev = expandAndWidth.y < 0.0;
  16. vec4 p = czm_computePosition();
  17. vec4 prev = czm_computePrevPosition();
  18. vec4 next = czm_computeNextPosition();
  19. v_width = width;
  20. v_st = st;
  21. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);
  22. gl_Position = czm_viewportOrthographic * positionWC;
  23. }