de.grogra.ray.physics
Interface Emitter

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

public interface Emitter
extends Scattering

The Emitter interface is the superinterface for all entities which emit a quantity of light transport: Light sources emit radiance, Sensors emit importance. Both sources and sensors are located at the extremal vertices of a complete light path, this interface provides the common methods needed for Monte Carlo-based photon tracing.

Author:
Ole Kniemeyer

Field Summary
 
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
 double completeRay(Environment env, Point3d vertex, Ray out)
           
 double computeExitance(Environment env, Spectrum exitance)
          Evaluates the exitance function for given input.
 void generateRandomOrigins(Environment env, RayList out, java.util.Random random)
          Pseudorandomly generates, for the given input, a set of origins for this emitter.
 
Methods inherited from interface de.grogra.ray.physics.Scattering
computeBSDF, generateRandomRays, getAverageColor, getFlags
 

Method Detail

completeRay

double completeRay(Environment env,
                   Point3d vertex,
                   Ray out)

computeExitance

double computeExitance(Environment env,
                       Spectrum exitance)
Evaluates the exitance function for given input. The computed value is the spectrum of the radiant exitance (emitted power per area) L0j(x, ν) at the point env.point in case of light sources, or the corresponding function W0j(x, ν) in case of sensors.

The returned value is the value of the probability density px that would be calculated by generateRandomOrigins(de.grogra.ray.physics.Environment, de.grogra.ray.util.RayList, java.util.Random) if env.point happened to be one of the randomly generated origins.

Parameters:
env - the environment for scattering
exitance - the exitance values will be placed in here
Returns:
the value of the probability density for the ray origin

generateRandomOrigins

void generateRandomOrigins(Environment env,
                           RayList out,
                           java.util.Random random)
Pseudorandomly generates, for the given input, a set of origins for this emitter. They are generated such that they can be used for Monte Carlo-based photon tracing algorithms in the following way.

At first, we consider the case where the emitter is in fact a light source. Let L(x, ω, ν) be the emitted spectral radiance for the frequency ν at the light's surface point x in direction ω. The radiant exitance (emitted spectral power per area) at x is defined as

L0(x, ν) = ∫ cos θ L(x, ω, ν) dω
where θ is the angle between the surface normal and ω. Now the directional distribution of the emitted radiance at x can be described by the density
L1(x, ω, ν) = L(x, ω, ν) / L0(x, ν)
so that the radiance is split into
L(x, ω, ν) = L0(x, ν) L1(x, ω, ν)
Let oi and si denote the origins and spectra of the N generated rays (N = rays.size). Then for a function f(x, ν) which is to be integrated over the light surface, the sum
1 / N ∑i si(ν) f(oi, ν)
is an unbiased estimate for the integral
∫ L0(x, ν) f(x, ν) dA
The integral ranges over the whole surface A of the light source. As a consequence, the spectrum of a ray is to be considered as the ray's radiant spectral power.

Now if the emitter is a sensor, let W(x, ω, ν) be the emitted spectral importance for frequency ν at the sensors's surface point x in direction ω. The quantities W0(x, ν) and W1(x, ω, ν) are defined similarly to the case of light sources:

W0(x, ν) = ∫ cos θ W(x, ω, ν) dω
W(x, ω, ν) = W0(x) W1(x, ω, ν)
The formulas for light sources are valid for sensors if the L-quantites are replaced by the corresponding W-quantities.

Let px be the probability density used for the ray origin, then the field originDensity is set to px(oi) for each ray. For emitters which are concentrated at a single point (e.g., point lights) px is not a regular function, the value originDensity will be set to a multiple of Scattering.DELTA_FACTOR.

The ray properties which are not mentioned in the given formulas are neither used nor modified. These are the direction and its density.

Parameters:
env - the environment
out - the outgoing rays to be generated
random - pseudorandom generator