materialInput.glsl 1.2 KB

12345678910111213141516171819202122232425262728
  1. /**
  2. * Used as input to every material's czm_getMaterial function.
  3. *
  4. * @name czm_materialInput
  5. * @glslStruct
  6. *
  7. * @property {float} s 1D texture coordinates.
  8. * @property {vec2} st 2D texture coordinates.
  9. * @property {vec3} str 3D texture coordinates.
  10. * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
  11. * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
  12. * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.
  13. * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials.
  14. * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
  15. * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.
  16. */
  17. struct czm_materialInput
  18. {
  19. float s;
  20. vec2 st;
  21. vec3 str;
  22. vec3 normalEC;
  23. mat3 tangentToEyeMatrix;
  24. vec3 positionToEyeEC;
  25. float height;
  26. float slope;
  27. float aspect;
  28. };