Module raytracer

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 Details

    • 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
    • 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(Random random)
      With this method the processor is initialized with the Randomizer actually before starting the ray tracing.
      Parameters:
      random - pseudorandom generator
    • getColorFromRay

      void getColorFromRay(Line ray, Spectrum resp, Color4f color, 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
    • appendStatistics

      void appendStatistics(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