|
JPBRT 0.5 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpbrt.core.Light
public abstract class Light
Light
defines the origin of a light source and the distribution of
energy that it emits.
References:
M. Pharr, G. Humphreys. (2004). Physically Based Rendering. Morgan Kaufmann.
Page 598.
Field Summary | |
---|---|
protected Transform |
lightToWorld
Light-to-world transformation. |
int |
nSamples
The number of samples is used for area light sources where it may be desirable to trace multiple shadow rays to the light to compute soft shadows. |
protected Transform |
worldToLight
The inverse of the light-to-world transformation. |
Constructor Summary | |
---|---|
Light(Transform l2w)
|
|
Light(Transform l2w,
int nSamples)
|
Method Summary | |
---|---|
int |
getNumSamples()
|
abstract boolean |
isDeltaLight()
Indicates whether the light is described by a delta distribution. |
Spectrum |
Le(RayDifferential ray)
Returns the emitted radiance of the light along a ray that didn't hit anything in the scene, page 625. |
abstract 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. |
abstract Spectrum |
power(Scene s)
Returns the total emitted power of the light into the scene. |
abstract 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. |
abstract Spectrum |
sampleL(Scene scene,
LightSample ls,
float u1,
float u2,
float time,
Ray ray,
Normal Ns,
float[] pdf)
|
void |
SHProject(Point p,
float pEpsilon,
int lmax,
Scene scene,
boolean computeLightVisibility,
float time,
RNG rng,
Spectrum[] coeffs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int nSamples
protected final Transform lightToWorld
protected final Transform worldToLight
Constructor Detail |
---|
public Light(Transform l2w)
public Light(Transform l2w, int nSamples)
l2w
- The light-to-world transform.nSamples
- Number of samples that should be taken for shadow rays.
Specify one for point light sources, and a value greater than one for
area light sources.Method Detail |
---|
public Spectrum Le(RayDifferential ray)
InfiniteAreaLight
's return a value different than 0.
public abstract float pdf(Point p, Vector wi)
public int getNumSamples()
public abstract Spectrum sampleL(Point p, float pEpsilon, LightSample ls, float time, Vector wi, float[] pdf, VisibilityTester vis)
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.
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.
public abstract Spectrum sampleL(Scene scene, LightSample ls, float u1, float u2, float time, Ray ray, Normal Ns, float[] pdf)
public void SHProject(Point p, float pEpsilon, int lmax, Scene scene, boolean computeLightVisibility, float time, RNG rng, Spectrum[] coeffs)
public abstract Spectrum power(Scene s)
public abstract boolean isDeltaLight()
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.
|
Copyright 2010 © by the authors and contributors of the JPBRT project. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |