Module raytracer

Interface Light

All Superinterfaces:
Emitter, Scattering
All Known Subinterfaces:
Light
All Known Implementing Classes:
AmbientLight, DirectionalLight, LightBase, Parallelogram, PhysicalLight, PointLight, Sky, SpectralLight, SpotLight, SunSkyLight, SunSkyToDirectionalLightWrapper

public interface Light extends Emitter
A Light instance represents a light source. The interface specializes the common methods of the Emitter interface for light sources.
Author:
Ole Kniemeyer
  • Field Details

    • NO_LIGHT

      static final int NO_LIGHT
      This return value for getLightType() indicates that this light should actually be ignored.
      See Also:
    • POINT

      static final int POINT
      This return value for getLightType() indicates a point light, i.e., a light source whose rays emanate from a single point. This includes the usual point lights which radiate equally in all directions, but also more general lights with a direction-dependent radiant intensity, e.g., spot lights.
      See Also:
    • AREA

      static final int AREA
      This return value for getLightType() indicates an area light.
      See Also:
    • DIRECTIONAL

      static final int DIRECTIONAL
      This return value for getLightType() indicates a directional light.
      See Also:
    • SKY

      static final int SKY
      This return value for getLightType() indicates a sky light.
      See Also:
    • AMBIENT

      static final int AMBIENT
      This return value for getLightType() indicates an ambient light. Ambient lights have no physically plausible counterpart in the real world and, thus, should not be considered in physically based rendering at all.
      See Also:
  • Method Details

    • getLightType

      int getLightType()
      Determines the type of light source which is represented by this light.
      Returns:
      one of NO_LIGHT, POINT, AREA, DIRECTIONAL, SKY, AMBIENT.
    • isShadowless

      boolean isShadowless()
      Determines whether the light source casts shadows or not.
      Returns:
      true iff the light source does not cast shadows
    • isIgnoredWhenHit

      boolean isIgnoredWhenHit()
      Determines whether the light source shall be ignored when a shot ray happens to hit the geometry of the light source.
      Returns:
      true iff the light source shall be ignored
    • getTotalPower

      double getTotalPower(Environment env)
      Computes the total power of this light source which is emitted to the region defined by env.bounds. Note that the computed value is not necessarily exact: It should be used just as a hint, e.g., when one of a set of lights has to be chosen randomly on the basis of their relative power.
      Parameters:
      env - environment which defines the bounds of the scene
      Returns:
      total power emitted to the region env.bounds