JPBRT 0.5

org.jpbrt.lights
Class DistantLight

java.lang.Object
  extended by org.jpbrt.core.Light
      extended by org.jpbrt.lights.DistantLight

public class DistantLight
extends Light

DistantLight.

References:
M. Pharr, G. Humphreys. (2004). Physically Based Rendering. Morgan Kaufmann.

Version:
$Id: DistantLight.java 13 2010-09-26 12:14:31Z rawcoder $
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class org.jpbrt.core.Light
lightToWorld, nSamples, worldToLight
 
Constructor Summary
DistantLight(Transform l2w, Spectrum radiance, Vector dir)
           
 
Method Summary
 boolean isDeltaLight()
          Indicates whether the light is described by a delta distribution.
 float pdf(Point p, Vector wi)
          The probability density function PDF describes the relative probability of a random variable taking on a particular value, page 634.
 Spectrum power(Scene scene)
          Returns the total emitted power of the light into the scene.
 Spectrum sampleL(Point p, float pEpsilon, LightSample ls, float time, Vector wi, float[] pdf, VisibilityTester vis)
          Returns the incident radiance from the light at a point p and also returns the direction vector wi that gives the direction from which radiance is arriving, assuming that there are no occluding objects between them.
 Spectrum sampleL(Scene scene, LightSample ls, float u1, float u2, float time, Ray ray, Normal Ns, float[] pdf)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jpbrt.core.Light
getNumSamples, Le, SHProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistantLight

public DistantLight(Transform l2w,
                    Spectrum radiance,
                    Vector dir)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sampleL

public Spectrum sampleL(Point p,
                        float pEpsilon,
                        LightSample ls,
                        float time,
                        Vector wi,
                        float[] pdf,
                        VisibilityTester vis)
Description copied from class: Light
Returns the incident radiance from the light at a point p and also returns the direction vector wi that gives the direction from which radiance is arriving, assuming that there are no occluding objects between them.

For some types of lights (usually area lights), light may arrive at p from many directions. For these types of lights, the sampleL method must randomly sample a poin on the light source's surface, so that Monte Carlo integration can be used to find the reflected light at p due to illumination from the light.

Page 598.

Specified by:
sampleL in class Light
Parameters:
p - A point in world coordinates.
wi - Output parameter. A direction vector giving the incident direction of the light. Pointing from p to a randomly selected point on the surface of the light source.
vis - Output parameter. The VisibilityTester is only initialized if the returned spectrum is not black. The visibility tester must be traced to verify that there are no occluding objects between the light source and p.
Returns:
The spectrum of the emitted light.

sampleL

public Spectrum sampleL(Scene scene,
                        LightSample ls,
                        float u1,
                        float u2,
                        float time,
                        Ray ray,
                        Normal Ns,
                        float[] pdf)
Specified by:
sampleL in class Light

power

public Spectrum power(Scene scene)
Description copied from class: Light
Returns the total emitted power of the light into the scene. This quantity is useful for light transport algorithms that may want to devote additional computational resources to lights in the scene that make the largest distributions.

Specified by:
power in class Light

isDeltaLight

public boolean isDeltaLight()
Description copied from class: Light
Indicates whether the light is described by a delta distribution. Such lights include point lights, which emit illumination from a single point, and directional lights, where all light arrives from the same direction. The only way to detect illumination from light sources like these is to call their Light.sampleL(org.jpbrt.core.Point, float, org.jpbrt.core.LightSample, float, org.jpbrt.core.Vector, float[], org.jpbrt.core.VisibilityTester) methods. It is impossible to randomly choose a direction from a point p that happens to find such a light source.

Specified by:
isDeltaLight in class Light

pdf

public float pdf(Point p,
                 Vector wi)
Description copied from class: Light
The probability density function PDF describes the relative probability of a random variable taking on a particular value, page 634.

Specified by:
pdf in class Light

Copyright 2010 © by the authors and contributors of the JPBRT project.
Some rights reserved.