modelMaterial.glsl 1.5 KB

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Struct for representing a material for a {@link Model}. The model
  3. * rendering pipeline will pass this struct between material, custom shaders,
  4. * and lighting stages. This is not to be confused with {@link czm_material}
  5. * which is used by the older Fabric materials system, although they are similar.
  6. * <p>
  7. * All color values (diffuse, specular, emissive) are in linear color space.
  8. * </p>
  9. *
  10. * @name czm_modelMaterial
  11. * @glslStruct
  12. *
  13. * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
  14. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
  15. * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
  16. * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
  17. * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
  18. * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
  19. * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
  20. */
  21. struct czm_modelMaterial {
  22. vec3 diffuse;
  23. float alpha;
  24. vec3 specular;
  25. float roughness;
  26. vec3 normalEC;
  27. float occlusion;
  28. vec3 emissive;
  29. };