cz.cuni.jagrlib.iface
Interface LightSource

All Superinterfaces:
Property
All Known Implementing Classes:
AmbientLightSource, DefaultLightSource, DirectionalLightSource, StaticAreaLightSource, StaticPointLightSource, StaticSphericalLightSource, StaticSpotLightSource

public interface LightSource
extends Property

Abstract light source in 3D scene.

Since:
0.11
See Also:
LightSource.java, BSSRDF, RTScene

Field Summary
static java.lang.String COLOR
          Property - [primary] surface [diffuse] color.
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 boolean getDirection(MicroFacet mf, double[] dir)
          Returns light direction between the source and the given MicroFacet.
 boolean getDirection(MicroFacet mf, int order, int total, double[] dir)
          Returns light direction between the source and the given MicroFacet.
 boolean getIntensity(MicroFacet mf, double[] color)
          Returns light intensity coming from the source to the given MicroFacet.
 boolean getIntensity(MicroFacet mf, int order, int total, double[] color)
          Returns light intensity coming from the source to the given MicroFacet.
 boolean isDeltaLight()
          Is delta light?
 boolean lights(MicroFacet mf)
          Lighting test from the source to the given MicroFacet.
 boolean lights(MicroFacet mf, int order, int total)
          Lighting test from the source to the given MicroFacet.
 double pdf(double[] point, double[] normal, double[] dir)
          Return probability density function.
 double sample(double u1, double v1, double u2, double v2, double[] pos, double[] dir, double[] power)
          Generates one photon leaving this light source.
 boolean sample(MicroFacet mf, double u, double v, double[] color, double[] dir, double[] pdf, boolean testVisibility)
          Sample the light by one shadow ray.
 Intersectable setIntersectable(Intersectable inter)
          Sets intersectable object (for light-source of visibility: lights(MicroFacet), ..).
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

COLOR

static final java.lang.String COLOR
Property - [primary] surface [diffuse] color.

See Also:
Constant Field Values
Method Detail

setIntersectable

Intersectable setIntersectable(Intersectable inter)
Sets intersectable object (for light-source of visibility: lights(MicroFacet), ..).


lights

boolean lights(MicroFacet mf)
Lighting test from the source to the given MicroFacet.

Parameters:
mf - The checked MicroFacet (point on surface of some solid).
Returns:
true if the light source lights on the given point.
See Also:
getIntensity(cz.cuni.jagrlib.MicroFacet, double[]), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

lights

boolean lights(MicroFacet mf,
               int order,
               int total)
Lighting test from the source to the given MicroFacet. Super-sampling variant.

Parameters:
mf - The checked MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
Returns:
true if the light source lights on the given point.
See Also:
getIntensity(cz.cuni.jagrlib.MicroFacet, double[]), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getIntensity

boolean getIntensity(MicroFacet mf,
                     double[] color)
Returns light intensity coming from the source to the given MicroFacet.

Parameters:
mf - The MicroFacet (point on surface of some solid).
color - Pre-allocated double[C] array to hold result - light intensity coming from the source to the given point (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
Returns:
true if the light source can light on the given point (cannot replace the lights() call!).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getIntensity

boolean getIntensity(MicroFacet mf,
                     int order,
                     int total,
                     double[] color)
Returns light intensity coming from the source to the given MicroFacet. Super-sampling variant.

Parameters:
mf - The MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
color - Pre-allocated double[C] array to hold result - light intensity coming from the source to the given point (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
Returns:
true if the light source can light on the given point (cannot replace the lights() call!).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getDirection

boolean getDirection(MicroFacet mf,
                     double[] dir)
Returns light direction between the source and the given MicroFacet.

Parameters:
mf - The MicroFacet (point on surface of some solid).
dir - Pre-allocated array to hold the result - normalised direction vector from the MicroFacet to the light source.
Returns:
false if the light source is not directional (thus dir is irrelevant).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getIntensity(cz.cuni.jagrlib.MicroFacet, double[])

getDirection

boolean getDirection(MicroFacet mf,
                     int order,
                     int total,
                     double[] dir)
Returns light direction between the source and the given MicroFacet. Super-sampling variant.

Parameters:
mf - The MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
dir - Pre-allocated array to hold the result - normalised direction vector from the MicroFacet to the light source.
Returns:
false if the light source is not directional (thus dir is irrelevant).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getIntensity(cz.cuni.jagrlib.MicroFacet, double[])

sample

boolean sample(MicroFacet mf,
               double u,
               double v,
               double[] color,
               double[] dir,
               double[] pdf,
               boolean testVisibility)
Sample the light by one shadow ray.

Parameters:
mf - The MicroFacet (point on surface of some solid).
ksi1 - Uniform random number.
ksi1 - Uniform random number.
color - Pre-allocated double[C] array to hold result - light intensity coming from the source to the given point (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
dir - Pre-allocated array to hold the result - normalised direction vector from the MicroFacet to the light source.
pdf - Probability density function.
Returns:
True if the light is visible.

sample

double sample(double u1,
              double v1,
              double u2,
              double v2,
              double[] pos,
              double[] dir,
              double[] power)
Generates one photon leaving this light source.

Parameters:
u1 - Uniform random number.
v1 - Uniform random number.
u2 - Uniform random number.
v2 - Uniform random number.
pos - Pre-allocated array which holds a point on the light source (an origin of direction).
dir - Output direction in world coordinates. Pre-allocated array.
power - Power of given light source (if you wanna get power of this photon, you have to divide this power by number of photons). Pre-allocated array.
Returns:
Probability density function of given ray.

pdf

double pdf(double[] point,
           double[] normal,
           double[] dir)
Return probability density function.

Parameters:
point - Point on the surface.
normal - Normal at this point.
dir - Direction from the point.

isDeltaLight

boolean isDeltaLight()
Is delta light?