SkyAtmosphereVS.glsl 659 B

123456789101112131415161718192021222324252627282930
  1. in vec4 position;
  2. out vec3 v_outerPositionWC;
  3. #ifndef PER_FRAGMENT_ATMOSPHERE
  4. out vec3 v_mieColor;
  5. out vec3 v_rayleighColor;
  6. out float v_opacity;
  7. out float v_translucent;
  8. #endif
  9. void main(void)
  10. {
  11. vec4 positionWC = czm_model * position;
  12. vec3 lightDirection = getLightDirection(positionWC.xyz);
  13. #ifndef PER_FRAGMENT_ATMOSPHERE
  14. computeAtmosphereScattering(
  15. positionWC.xyz,
  16. lightDirection,
  17. v_rayleighColor,
  18. v_mieColor,
  19. v_opacity,
  20. v_translucent
  21. );
  22. #endif
  23. v_outerPositionWC = positionWC.xyz;
  24. gl_Position = czm_modelViewProjection * position;
  25. }