PBRDirectionalLight.glsl 928 B

1234567891011121314151617181920
  1. //! Function computes contribution of directional light source
  2. //! into global variable DirectLighting (PBR shading).
  3. //! @param theId light source index
  4. //! @param theNormal surface normal
  5. //! @param theView view direction
  6. //! @param theIsFront front/back face flag
  7. //! @param theShadow shadow attenuation
  8. void occDirectionalLight (in int theId,
  9. in vec3 theNormal,
  10. in vec3 theView,
  11. in bool theIsFront,
  12. in float theShadow)
  13. {
  14. vec3 aLight = occLight_Position (theId);
  15. theNormal = theIsFront ? theNormal : -theNormal;
  16. DirectLighting += occPBRIllumination (theView, aLight, theNormal,
  17. BaseColor, Metallic, Roughness, IOR,
  18. occLight_Specular (theId),
  19. occLight_Intensity(theId)) * theShadow;
  20. }