java.lang.Object
de.grogra.ray2.tracing.ProcessorBase
de.grogra.ray2.light.DefaultLightProcessor
- All Implemented Interfaces:
LightProcessor
,Cloneable
This class implements a standard
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.- Author:
- Michael Tauer, Ole Kniemeyer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendStatisticsImpl
(StringBuffer stats) Returns a clone of thisLightProcessor
.void
getLightRays
(boolean frontFace, Intersection desc, RayList rays, ArrayList cache, Random rnd) Adds all light rays that directly illuminate the specified intersection pointis
to the listrays
.void
initialize
(Scene scene, int raytracerType, Random rnd) Initializes the light processor for use with the givenscene
.protected void
protected void
void
useGeometryTerm
(boolean use) void
useOneSamplePerLight
(boolean one) Methods inherited from class de.grogra.ray2.tracing.ProcessorBase
appendStatistics, clone
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.ray2.light.LightProcessor
appendStatistics
-
Constructor Details
-
DefaultLightProcessor
public DefaultLightProcessor()
-
-
Method Details
-
useGeometryTerm
public void useGeometryTerm(boolean use) -
useOneSamplePerLight
public void useOneSamplePerLight(boolean one) -
dup
Description copied from interface:LightProcessor
Returns a clone of thisLightProcessor
. All constant variables are copied shallowly, state variables are newly created and copied where necessary.- Specified by:
dup
in interfaceLightProcessor
- Parameters:
scene
- duplicate of scene- Returns:
- clone of this light processor
-
initialize
Description copied from interface:LightProcessor
Initializes the light processor for use with the givenscene
.- Specified by:
initialize
in interfaceLightProcessor
- Parameters:
scene
- the scene in which light rays are to be computedraytracerType
- type of raytracerrnd
- pseudorandom generator (Environment.STANDARD_RAY_TRACER
orEnvironment.PATH_TRACER
)
-
initLocals
protected void initLocals()- Overrides:
initLocals
in classProcessorBase
-
getLightRays
public void getLightRays(boolean frontFace, Intersection desc, RayList rays, ArrayList cache, Random rnd) Description copied from interface:LightProcessor
Adds all light rays that directly illuminate the specified intersection pointis
to the listrays
.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.- Specified by:
getLightRays
in interfaceLightProcessor
- Parameters:
frontFace
- 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 generator
-
mergeStatistics
- Overrides:
mergeStatistics
in classProcessorBase
-
appendStatisticsImpl
- Specified by:
appendStatisticsImpl
in classProcessorBase
-