CloudCollectionVS.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "#ifdef INSTANCED\n\
  3. in vec2 direction;\n\
  4. #endif\n\
  5. in vec4 positionHighAndScaleX;\n\
  6. in vec4 positionLowAndScaleY;\n\
  7. in vec4 packedAttribute0;\n\
  8. in vec4 packedAttribute1;\n\
  9. in vec4 color;\n\
  10. \n\
  11. out vec2 v_offset;\n\
  12. out vec3 v_maximumSize;\n\
  13. out vec4 v_color;\n\
  14. out float v_slice;\n\
  15. out float v_brightness;\n\
  16. \n\
  17. void main() {\n\
  18. // Unpack attributes.\n\
  19. vec3 positionHigh = positionHighAndScaleX.xyz;\n\
  20. vec3 positionLow = positionLowAndScaleY.xyz;\n\
  21. vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);\n\
  22. \n\
  23. float show = packedAttribute0.x;\n\
  24. float brightness = packedAttribute0.y;\n\
  25. vec2 coordinates = packedAttribute0.wz;\n\
  26. vec3 maximumSize = packedAttribute1.xyz;\n\
  27. float slice = packedAttribute1.w;\n\
  28. \n\
  29. #ifdef INSTANCED\n\
  30. vec2 dir = direction;\n\
  31. #else\n\
  32. vec2 dir = coordinates;\n\
  33. #endif\n\
  34. \n\
  35. vec2 offset = dir - vec2(0.5, 0.5);\n\
  36. vec2 scaledOffset = scale * offset;\n\
  37. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n\
  38. vec4 positionEC = czm_modelViewRelativeToEye * p;\n\
  39. positionEC.xy += scaledOffset;\n\
  40. \n\
  41. positionEC.xyz *= show;\n\
  42. gl_Position = czm_projection * positionEC;\n\
  43. \n\
  44. v_offset = offset;\n\
  45. v_maximumSize = maximumSize;\n\
  46. v_color = color;\n\
  47. v_slice = slice;\n\
  48. v_brightness = brightness;\n\
  49. }\n\
  50. ";