PolylineMaterialAppearanceVS.glsl 915 B

12345678910111213141516171819202122232425262728293031323334
  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. attribute float batchId;
  10. varying float v_width;
  11. varying vec2 v_st;
  12. varying float v_polylineAngle;
  13. void main()
  14. {
  15. float expandDir = expandAndWidth.x;
  16. float width = abs(expandAndWidth.y) + 0.5;
  17. bool usePrev = expandAndWidth.y < 0.0;
  18. vec4 p = czm_computePosition();
  19. vec4 prev = czm_computePrevPosition();
  20. vec4 next = czm_computeNextPosition();
  21. v_width = width;
  22. v_st = st;
  23. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_polylineAngle);
  24. gl_Position = czm_viewportOrthographic * positionWC;
  25. #ifdef LOG_DEPTH
  26. czm_vertexLogDepth(czm_modelViewProjectionRelativeToEye * p);
  27. #endif
  28. }