Interface GiLightProvider

All Known Implementing Classes:
GlobalIllumination

public interface GiLightProvider
Optional provider of global-illumination data for LightingManager. When a provider is installed, the per-polygon lighting computation additionally:
  • asks the provider whether each light source is occluded from the polygon (direct-light shadows), and
  • adds the provider's indirect (bounced light) contribution.

Implementations are called from parallel render-pool threads: all methods must be thread-safe, fast and allocation-free. Providers are expected to answer from progressively updated caches.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addIndirectLight(SolidPolygon polygon, Color baseColor, Color result)
    Adds the polygon's indirect (bounced light) contribution to an already computed direct-lighting color, in place.
    boolean
    Tells whether a light source currently has an unobstructed path to the polygon.
  • Method Details

    • isLightVisible

      boolean isLightVisible(SolidPolygon polygon, LightSource light)
      Tells whether a light source currently has an unobstructed path to the polygon. Until the provider has computed the answer, it should return true (light visible): shadows then fade in gradually instead of popping out.
      Parameters:
      polygon - the shaded polygon
      light - the light source being evaluated
      Returns:
      true if the light reaches the polygon
    • addIndirectLight

      void addIndirectLight(SolidPolygon polygon, Color baseColor, Color result)
      Adds the polygon's indirect (bounced light) contribution to an already computed direct-lighting color, in place.
      Parameters:
      polygon - the shaded polygon
      baseColor - the polygon's unlit color (for albedo scaling)
      result - the direct-lighted color to augment (modified in place)