源代码

  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. };

文档

1. 成员 s

类型

float

含义

一维纹理坐标

2. 成员 st

类型

vec2

含义

二维纹理坐标

3. 成员 str

类型

vec3

含义

三维纹理坐标

4. 成员 normalEC

类型

vec3

含义

观察坐标(eye-coordinate,EC)中的法向量。

5. 成员 tangentToEyeMatrix

类型

mat3

5. 成员 positionToEyeEC

类型

vec3

6. 成员 height

类型

float

7. 成员 slope

类型

float

8. 成员 aspect

类型

float