de.grogra.ray.physics
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 Summary
static int AMBIENT
          This return value for getLightType() indicates an ambient light.
static int AREA
          This return value for getLightType() indicates an area light.
static int DIRECTIONAL
          This return value for getLightType() indicates a directional light.
static int NO_LIGHT
          This return value for getLightType() indicates that this light should actually be ignored.
static int POINT
          This return value for getLightType() indicates a point light, i.e., a light source whose rays emanate from a single point.
static int SKY
          This return value for getLightType() indicates a sky light.
 
Fields inherited from interface de.grogra.ray.physics.Scattering
DELTA_FACTOR, IS_NON_OPAQUE, MIN_UNUSED_FLAG, NEEDS_NORMAL, NEEDS_POINT, NEEDS_TANGENTS, NEEDS_TRANSFORMATION, NEEDS_UV, RANDOM_RAYS_GENERATE_ORIGINS
 
Method Summary
 int getLightType()
          Determines the type of light source which is represented by this light.
 double getTotalPower(Environment env)
          Computes the total power of this light source which is emitted to the region defined by env.bounds.
 boolean isIgnoredWhenHit()
          Determines whether the light source shall be ignored when a shot ray happens to hit the geometry of the light source.
 boolean isShadowless()
          Determines whether the light source casts shadows or not.
 
Methods inherited from interface de.grogra.ray.physics.Emitter
completeRay, computeExitance, generateRandomOrigins
 
Methods inherited from interface de.grogra.ray.physics.Scattering
computeBSDF, generateRandomRays, getAverageColor, getFlags
 

Field Detail

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:
Constant Field Values

AREA

static final int AREA
This return value for getLightType() indicates an area light.

See Also:
Constant Field Values

DIRECTIONAL

static final int DIRECTIONAL
This return value for getLightType() indicates a directional light.

See Also:
Constant Field Values

NO_LIGHT

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

See Also:
Constant Field Values

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:
Constant Field Values

SKY

static final int SKY
This return value for getLightType() indicates a sky light.

See Also:
Constant Field Values
Method Detail

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.

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

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

isShadowless

boolean isShadowless()
Determines whether the light source casts shadows or not.

Returns:
true iff the light source does not cast shadows