de.grogra.ray2.light
public class DefaultLightProcessor extends ProcessorBase implements LightProcessor
LightProcessor.
For lights which are not shadowless, it shoots a shadow ray
in order to check if the light source is visible at a specific
point. If this ray hits any object, the point is considered
to be in the shadow of the light.| Constructor and Description |
|---|
DefaultLightProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendStatisticsImpl(java.lang.StringBuffer stats) |
LightProcessor |
dup(Scene scene)
Returns a clone of this
LightProcessor. |
void |
getLightRays(boolean frontFace,
Intersection desc,
RayList rays,
java.util.ArrayList cache,
java.util.Random rnd)
Adds all light rays that directly illuminate the specified
intersection point
is to the list rays. |
void |
initialize(Scene scene,
int raytracerType,
java.util.Random rnd)
Initializes the light processor for use with the given
scene. |
protected void |
initLocals() |
protected void |
mergeStatistics(ProcessorBase src) |
void |
useGeometryTerm(boolean use) |
void |
useOneSamplePerLight(boolean one) |
appendStatistics, cloneequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendStatisticsprotected void appendStatisticsImpl(java.lang.StringBuffer stats)
appendStatisticsImpl in class ProcessorBasepublic LightProcessor dup(Scene scene)
LightProcessorLightProcessor.
All constant variables are copied shallowly, state variables
are newly created and copied where necessary.dup in interface LightProcessorscene - duplicate of scenepublic void getLightRays(boolean frontFace,
Intersection desc,
RayList rays,
java.util.ArrayList cache,
java.util.Random rnd)
LightProcessoris to the list rays.
frontFace indicates whether the front face
(the side where the normal vector points to)
or the back face of the surface at the intersection point is to be
illuminated.
The cache may be used freely by implementations
of this method in order to store some caching information.
Invokers of this method should provide the same cache for
similar situations. E.g., a raytracer should provide an own cache
for every node of the recursive raytracing tree.
getLightRays in interface LightProcessorfrontFace - illuminate front face or back face?desc - the intersection pointrays - all determined rays are added to this listcache - the cache may be used freely by implementationsrnd - pseudorandom generatorpublic void initialize(Scene scene, int raytracerType, java.util.Random rnd)
LightProcessorscene.initialize in interface LightProcessorscene - the scene in which light rays are to be computedraytracerType - type of raytracerrnd - pseudorandom generator
(Environment.STANDARD_RAY_TRACER or
Environment.PATH_TRACER)protected void initLocals()
initLocals in class ProcessorBaseprotected void mergeStatistics(ProcessorBase src)
mergeStatistics in class ProcessorBasepublic void useGeometryTerm(boolean use)
public void useOneSamplePerLight(boolean one)