de.grogra.ray2.tracing
Interface RayProcessor

All Known Implementing Classes:
BiDirectionalProcessor, DefaultRayProcessor, LineTracer, MetropolisProcessor, PathTracer, PhotonMapRayProcessor, Radiosity, RayProcessorBase

public interface RayProcessor

An implementation of this interface encapsulates the raytracing algorithm for a single ray. Such an algorithm needs information about the whole scene, this information is obtained through the PixelwiseRenderer which is passed to the initialize method.

Author:
Michael Tauer, Ole Kniemeyer

Method Summary
 void appendStatistics(java.lang.StringBuffer stats)
          Appends some statistics information about the ray processing to stats.
 RayProcessor dup(Scene scene)
          Returns a clone of this RayProcessor.
 void getColorFromRay(Line ray, Spectrum resp, Color4f color, java.util.Random random)
          The main method of a ray processor.
 void initialize(PixelwiseRenderer renderer, Scene scene)
          With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.
 void initializeBeforeTracing(java.util.Random random)
          With this method the processor is initialized with the Randomizer actually before starting the ray tracing.
 

Method Detail

appendStatistics

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

Parameters:
stats - buffer for statistics information

dup

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

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

getColorFromRay

void getColorFromRay(Line ray,
                     Spectrum resp,
                     Color4f color,
                     java.util.Random random)
The main method of a ray processor. This method computes a color for the specified ray. color.w contains the alpha value for the ray, the other components are premultiplied with this alpha value.

Parameters:
ray - input - calculate for this ray
resp - responsivity of camera
color - output - the calculated color
random - pseudorandom generator

initialize

void initialize(PixelwiseRenderer renderer,
                Scene scene)
With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.

Parameters:
renderer - the renderer which provides the needed information
scene - the scene which is rendered

initializeBeforeTracing

void initializeBeforeTracing(java.util.Random random)
With this method the processor is initialized with the Randomizer actually before starting the ray tracing.

Parameters:
random - pseudorandom generator