Module raytracer

Class RayProcessorBase

java.lang.Object
de.grogra.ray2.tracing.ProcessorBase
de.grogra.ray2.tracing.RayProcessorBase
All Implemented Interfaces:
RayProcessor, Cloneable
Direct Known Subclasses:
DefaultRayProcessor, PathTracer, PhotonMapRayProcessor, Radiosity

public abstract class RayProcessorBase extends ProcessorBase implements RayProcessor
  • Field Details

  • Constructor Details

    • RayProcessorBase

      public RayProcessorBase()
  • Method Details

    • setLightProcessor

      public void setLightProcessor(LightProcessor proc)
    • getLightProcessor

      public LightProcessor getLightProcessor()
    • setRecursionDepth

      public void setRecursionDepth(int value)
    • dup

      public RayProcessor dup(Scene scene)
      Description copied from interface: RayProcessor
      Returns a clone of this RayProcessor. All constant variables are copied shallowly, state variables are newly created and copied where necessary.
      Specified by:
      dup in interface RayProcessor
      Parameters:
      scene - duplicate of scene
      Returns:
      clone of this ray processor
    • mergeStatistics

      protected void mergeStatistics(ProcessorBase src)
      Overrides:
      mergeStatistics in class ProcessorBase
    • initLocals

      protected void initLocals()
      Overrides:
      initLocals in class ProcessorBase
    • initialize

      public void initialize(PixelwiseRenderer renderer, Scene scene)
      Description copied from interface: RayProcessor
      With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.
      Specified by:
      initialize in interface RayProcessor
      Parameters:
      renderer - the renderer which provides the needed information
      scene - the scene which is rendered
    • initializeBeforeTracing

      public void initializeBeforeTracing(Random random)
      Description copied from interface: RayProcessor
      With this method the processor is initialized with the Randomizer actually before starting the ray tracing.
      Specified by:
      initializeBeforeTracing in interface RayProcessor
      Parameters:
      random - pseudorandom generator
    • getIOR

      public double getIOR(Intersection is, Spectrum spec)
    • getColorFromRay

      public void getColorFromRay(Line ray, Spectrum resp, Color4f color, Random random)
      Description copied from interface: RayProcessor
      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.
      Specified by:
      getColorFromRay in interface RayProcessor
      Parameters:
      ray - input - calculate for this ray
      resp - responsivity of camera
      color - output - the calculated color
      random - pseudorandom generator