

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object de.grogra.persistence.ShareableBase de.grogra.imp3d.objects.SpectralLight
public class SpectralLight
Nested Class Summary  

static class 
SpectralLight.Type

Field Summary  

static SpectralLight.Type 
$TYPE

static SCOType.Field 
light$FIELD

static SCOType.Field 
power$FIELD

static SCOType.Field 
spectrum$FIELD

Fields inherited from interface de.grogra.ray.physics.Light 

AMBIENT, AREA, DIRECTIONAL, NO_LIGHT, POINT, SKY 
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 
Constructor Summary  

SpectralLight()
spectral light constructor 

SpectralLight(SpectralCurve curve)
spectral light constructor 
Method Summary  

void 
accept(LightVisitor visitor)

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

float 
computeBSDF(Environment env,
Vector3f in,
Spectrum specIn,
Vector3f out,
boolean adjoint,
Spectrum bsdf)
Evaluates bidirectional scattering distribution function for given input. 
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. 
void 
generateRandomRays(Environment env,
Vector3f out,
Spectrum specOut,
RayList rays,
boolean adjoint,
java.util.Random random)
Pseudorandomly generates, for the given input, a set of scattered rays. 
int 
getAverageColor()
Returns an average color for the scattering entity. 
int 
getFlags()

Light 
getLight()

int 
getLightType()
Determines the type of light source which is represented by this light. 
ManageableType 
getManageableType()

float 
getPower()

SpectralLightMap 
getSpectrum()

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. 
void 
setLight(Light light)
Sets the directional emission distribution of the spectal light. 
void 
setPower(float value)

void 
setSpectrum(SpectralCurve curve)
sets the spectral distribution 
void 
setSpectrum(SpectralLightMap value)

Methods inherited from class de.grogra.persistence.ShareableBase 

addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 

public static final SpectralLight.Type $TYPE
public static final SCOType.Field light$FIELD
public static final SCOType.Field power$FIELD
public static final SCOType.Field spectrum$FIELD
Constructor Detail 

public SpectralLight()
public SpectralLight(SpectralCurve curve)
curve
 the spectral curve, used by the lightsouceMethod Detail 

public void accept(LightVisitor visitor)
public double completeRay(Environment env, Point3d vertex, Ray out)
completeRay
in interface Emitter
public float computeBSDF(Environment env, Vector3f in, Spectrum specIn, Vector3f out, boolean adjoint, Spectrum bsdf)
Scattering
The computed spectrum is an integral over the spectrum of the following product:
env.point
,
ω_{i} the (negated) direction of the incoming light ray,
ν_{i} the frequency where the incoming ray is sampled,
ω_{o} the direction of the outgoing light ray,
ν_{o} the frequency where the outgoing ray is sampled,
and θ the angle between the surface normal and out
.
If adjoint
is false
, in
and
out
describe true light rays from light sources to sensors.
In this case, ω_{i} = in
,
ω_{o} = out
, and the integral is
bsdf
(ν) = cos θ ∫ BSDF(in
, ν_{i};
out
, ν) specIn
(ν_{i}) dν_{i}
adjoint
is true
. in
and
out
then describe importance rays (inverse light rays
from sensors to light sources). In this case,
ω_{i} = out
,
ω_{o} = in
, and the integral is
bsdf
(ν) = cos θ ∫
BSDF(out
, ν;
in
, ν_{o}) specIn
(ν_{o}) dν_{o}
If this Scattering
instance is in fact a
Light
source, adjoint
is false
,
and the BSDF is defined as BSDF(in
, μ; ω, ν)
= L^{1}(ω, ν) δ(μ  ν),
i.e., the directional distribution
of the emitted radiance at env.point
, see Emitter
.
In this case, in
is not used.
If this Scattering
instance is in fact a
Sensor
, adjoint
is true
,
and the BSDF is defined as BSDF(ω, ν; in
, μ)
= W^{1}(ω, ν) δ(μ  ν),
i.e., the directional distribution
of the emitted importance at env.point
, see Emitter
.
In this case, in
is not used.
The computation should be physically valid. This excludes, e.g., ambient or emissive light contributions.
The returned value
is the value of the probability density p_{ω}
that would be calculated by Scattering.generateRandomRays(de.grogra.ray.physics.Environment, javax.vecmath.Vector3f, de.grogra.ray.physics.Spectrum, de.grogra.ray.util.RayList, boolean, java.util.Random)
if
the ray happened to be one of the randomly generated rays.
computeBSDF
in interface Scattering
env
 the environment for scatteringin
 the (negated) direction unit vector of the incoming ray
(i.e., pointing away from the surface)specIn
 the spectrum of the incoming rayout
 the direction unit vector of the outgoing ray
(i.e., pointing away from the surface)adjoint
 light ray or importance ray?bsdf
 the computed spectrum of the outgoing ray will be placed in here
public double computeExitance(Environment env, Spectrum exitance)
Emitter
env.point
in case of light sources, or the
corresponding function W^{0}_{j}(x, ν) in case
of sensors.
The returned value
is the value of the probability density p_{x}
that would be calculated by Emitter.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.
computeExitance
in interface Emitter
env
 the environment for scatteringexitance
 the exitance values will be placed in here
public void generateRandomOrigins(Environment env, RayList out, java.util.Random random)
Emitter
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
rays.size
). Then
for a function f(x, ν) which is to be
integrated over the light surface, the sum
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 W^{0}(x, ν) and W^{1}(x, ω, ν) are defined similarly to the case of light sources:
Let p_{x} be the probability density used for the ray
origin, then the field originDensity
is set to p_{x}(o_{i}) for each ray.
For emitters which are concentrated at a single point
(e.g., point lights) p_{x} 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.
generateRandomOrigins
in interface Emitter
env
 the environmentout
 the outgoing rays to be generatedrandom
 pseudorandom generatorpublic void generateRandomRays(Environment env, Vector3f out, Spectrum specOut, RayList rays, boolean adjoint, java.util.Random random)
Scattering
adjoint
is false
,
out
= ω_{o} describes
the direction of an outgoing light ray.
In this case, the integration is with respect to ω_{i}.
Let g(ω, ν; out
, μ)
= BSDF(ω, ν; out
, μ)
adjoint
is true
. In this case,
out
= ω_{i} describes
the direction of an outgoing importance ray (an inverse light ray).
Now the integration is with respect to ω_{o}.
Let g(ω, ν; out
, μ)
= BSDF(out
, μ; ω, ν)
rays.size
). Then, for every
frequency ν the sum
out
, μ)
specOut
(μ) dμ dω
If this Scattering
instance is in fact a
Light
source, adjoint
is true
,
and the BSDF is defined as BSDF(out
, μ; ω, ν)
= L^{1}(ω, ν) δ(μ  ν),
i.e., the directional distribution
of the emitted radiance at env.point
, see Emitter
.
In this case, out
is not used.
If this Scattering
instance is in fact a
Sensor
, adjoint
is false
,
and the BSDF is defined as BSDF(ω, ν; out
, μ)
= W^{1}(ω, ν) δ(μ  ν),
i.e., the directional distribution
of the emitted importance at env.point
, see Emitter
.
In this case, out
is not used.
Let p_{ω} be the probability density
used for the ray direction (measured with respect to
solid angle ω),
then the field directionDensity
of the ray i
is set to p_{ω}(d_{i}).
For ideal specular reflection or transmission, or for directional
lights or sensors, p_{ω} is not
a regular function, the value directionDensity
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 origin and its density.
generateRandomRays
in interface Scattering
env
 the environment for scatteringout
 the direction unit vector of the outgoing ray
(i.e., pointing away from the surface)specOut
 the spectrum of the outgoing rayrays
 the rays to be generatedadjoint
 represents out
a light ray or an importance ray?random
 pseudorandom generatorScattering.computeBSDF(de.grogra.ray.physics.Environment, javax.vecmath.Vector3f, de.grogra.ray.physics.Spectrum, javax.vecmath.Vector3f, boolean, de.grogra.ray.physics.Spectrum)
public int getAverageColor()
Scattering
getAverageColor
in interface Scattering
public int getFlags()
getFlags
in interface Scattering
public Light getLight()
public int getLightType()
Light
getLightType
in interface Light
Light.NO_LIGHT
, Light.POINT
, Light.AREA
,
Light.DIRECTIONAL
, Light.SKY
, Light.AMBIENT
.public ManageableType getManageableType()
getManageableType
in interface Manageable
public float getPower()
public SpectralLightMap getSpectrum()
public double getTotalPower(Environment env)
Light
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.
getTotalPower
in interface Light
env
 environment which defines the bounds of the scene
env.bounds
isIgnoredWhenHit
public boolean isIgnoredWhenHit()
 Description copied from interface:
Light
 Determines whether the light source shall be ignored when a shot ray
happens to hit the geometry of the light source.
 Specified by:
isIgnoredWhenHit
in interface Light
 Returns:
true
iff the light source shall be ignored
isShadowless
public boolean isShadowless()
 Description copied from interface:
Light
 Determines whether the light source casts shadows or not.
 Specified by:
isShadowless
in interface Light
 Returns:
true
iff the light source does not cast shadows
setLight
public void setLight(Light light)
 Sets the directional emission distribution of the spectal light.
The directional emission distribution of the input lights is used as emission distribution
 Parameters:
light
 input light
setPower
public void setPower(float value)
setSpectrum
public void setSpectrum(SpectralCurve curve)
 sets the spectral distribution
 Parameters:
curve
 is the spectral distribution
setSpectrum
public void setSpectrum(SpectralLightMap value)
Overview
Package
Class
Tree
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED  FIELD  CONSTR  METHOD
DETAIL: FIELD  CONSTR  METHOD