de.grogra.ray2.light
Interface LightProcessor

All Known Implementing Classes:
DefaultLightProcessor

public interface LightProcessor

Interface that encapsulates the specific light calculation. It has to compute all light rays that directly illuminate a specific intersection point.

Author:
Michaal Tauer, Ole Kniemeyer

Method Summary
 void appendStatistics(java.lang.StringBuffer stats)
          Appends some statistics information about the light computations to stats.
 LightProcessor dup(Scene scene)
          Returns a clone of this LightProcessor.
 void getLightRays(boolean frontFace, Intersection is, RayList rays, java.util.ArrayList cache, java.util.Random random)
          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 random)
          Initializes the light processor for use with the given scene.
 

Method Detail

appendStatistics

void appendStatistics(java.lang.StringBuffer stats)
Appends some statistics information about the light computations to stats. This method will be invoked after the whole rendering process has completed.

Parameters:
stats - buffer for statistics information

dup

LightProcessor dup(Scene scene)
Returns a clone of this LightProcessor. All constant variables are copied shallowly, state variables are newly created and copied where necessary.

Parameters:
scene - duplicate of scene
Returns:
clone of this light processor

getLightRays

void getLightRays(boolean frontFace,
                  Intersection is,
                  RayList rays,
                  java.util.ArrayList cache,
                  java.util.Random random)
Adds all light rays that directly illuminate the specified intersection point is 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.

Parameters:
frontFace - illuminate front face or back face?
is - the intersection point
rays - all determined rays are added to this list
cache - the cache may be used freely by implementations
random - pseudorandom generator

initialize

void initialize(Scene scene,
                int raytracerType,
                java.util.Random random)
Initializes the light processor for use with the given scene.

Parameters:
scene - the scene in which light rays are to be computed
raytracerType - type of raytracer
random - pseudorandom generator (Environment.STANDARD_RAY_TRACER or Environment.PATH_TRACER)