Module raytracer

Class MetropolisRenderer

All Implemented Interfaces:
Renderer

public class MetropolisRenderer extends PixelwiseRenderer
  • Field Details

    • INITIAL_COUNT

      public static final String INITIAL_COUNT
      See Also:
    • SEED_COUNT

      public static final String SEED_COUNT
      See Also:
    • MUTATION_PP_COUNT

      public static final String MUTATION_PP_COUNT
      See Also:
    • FIRST_STAGE

      public static final int FIRST_STAGE
      See Also:
    • SECOND_STAGE

      public static final int SECOND_STAGE
      See Also:
    • pixelChangeArray

      protected int[] pixelChangeArray
    • initialCount

      public static int initialCount
    • seedPathCount

      public static int seedPathCount
    • mutationPPCount

      public static int mutationPPCount
    • mutatedPixPerProc

      public int mutatedPixPerProc
    • solverCount

      public int solverCount
    • notMutatedPixelsLeft

      public int notMutatedPixelsLeft
    • twoStage_Ref

      public static boolean twoStage_Ref
    • directLightning_Ref

      public static boolean directLightning_Ref
    • expectedValues_Ref

      public static boolean expectedValues_Ref
    • importanceSampling_Ref

      public static boolean importanceSampling_Ref
    • actRenderingStage

      public static int actRenderingStage
    • firstStageImage

      protected BufferedImage firstStageImage
    • firstStageRgbaPixels

      protected int[] firstStageRgbaPixels
    • firstStageHdrPixels

      protected float[][] firstStageHdrPixels
    • firstStageBrightestValue

      protected Color4f firstStageBrightestValue
    • firstStageDarkestValue

      protected Color4f firstStageDarkestValue
    • firstStageAverageValue

      protected Color4f firstStageAverageValue
    • testimageCorrectionFactor

      protected static float testimageCorrectionFactor
    • testimageMutperPix

      public static int testimageMutperPix
    • rnd

      protected MTRandom rnd
  • Constructor Details

    • MetropolisRenderer

      public MetropolisRenderer()
  • Method Details

    • stop

      public void stop()
      Description copied from class: Task
      This method is invoked in order to stop the computation of this task.
      Specified by:
      stop in interface Renderer
      Overrides:
      stop in class Task
    • initialize

      public void initialize(Options opts, ProgressMonitor progress)
      Description copied from interface: Renderer
      Initializes the renderer. This method has to be invoked at first.
      Specified by:
      initialize in interface Renderer
      Overrides:
      initialize in class PixelwiseRenderer
      Parameters:
      opts - options to use (may be null)
      progress - monitor to display rendering progress (may be null)
    • render

      public void render(Scene scene, Sensor camera, Matrix4d cameraTransformation, int width, int height, ImageObserver obs)
      Description copied from interface: Renderer
      Renders an image of a scene.
      Specified by:
      render in interface Renderer
      Overrides:
      render in class PixelwiseRenderer
      Parameters:
      scene - scene to render
      camera - camera to use
      cameraTransformation - transformation from camera coordinates to world coordinates
      width - width of image
      height - height of image
      obs - the observer receives the image data
    • createLocalSolver

      public Solver createLocalSolver(boolean sameThread)
      Overrides:
      createLocalSolver in class PixelwiseRenderer
    • nextPartialTask

      protected PartialTask nextPartialTask(int solverIndex)
      Description copied from class: Task
      This method returns the next partial task for this task. If all parts of the task have been solved or currently are being solved, null is returned. However, a later invocation may return a partial task if a currently active solver does not completely solve its partial task.
      Overrides:
      nextPartialTask in class PixelwiseRenderer
      Parameters:
      solverIndex - index of solver which will be used for next task
      Returns:
      next partial task, or null
    • dispose

      protected void dispose(PartialTask task)
      Description copied from class: Task
      This method is invoked when an active solver is removed or invokes Task.partialTaskDone(Solver) in order to tell this task that the partial task of the solver is no longer processed. Note that the solver may not have completely processed its partial task.
      Overrides:
      dispose in class PixelwiseRenderer
      Parameters:
      task - partial task which is no longer processed
    • increaseNotMutatedPixels

      public void increaseNotMutatedPixels(int count)
    • done

      protected boolean done()
      Description copied from class: Task
      Returns true iff the complete task has been solved.
      Overrides:
      done in class PixelwiseRenderer
      Returns:
      has the task been solved?
    • renderMLT

      protected void renderMLT(Antialiasing antialiasing, int mutatedPixPerProc, int solverNo, PixelwiseRenderer.Result res)
    • merge

      public void merge(PixelwiseRenderer.Result res)
      Overrides:
      merge in class PixelwiseRenderer
    • getPixelsForLine2Vertex

      public float[] getPixelsForLine2Vertex(Environment env, Point3d vertex)
    • getFirstStageImageValue

      public float getFirstStageImageValue(int x, int y)