Module raytracer

Class ZBuffer

java.lang.Object
de.grogra.ray2.radiosity.ZBuffer

public class ZBuffer extends Object
This class implements a Z-buffer for one side of the hemicube.
Author:
Ralf Kopsch
  • Constructor Details

    • ZBuffer

      public ZBuffer(boolean isTop)
      Creates a new z-buffer.
      Parameters:
      isTop - true, if this is the top side of a hemicube.
  • Method Details

    • insert

      public void insert(SubPatch p, SubPatch originalPatch)
      Inserts a new patch into the buffer.
      Parameters:
      p - a rotated patch
      originalPatch - the unmodified patch
    • getZPixel

      public ZPixel getZPixel(int x, int y)
      Returns a pixel from this buffer.
      Parameters:
      x - the x-coordinate.
      y - the y-coordinate.
      Returns:
      Returns a pixel from this buffer.
    • fillFormFactors

      public void fillFormFactors(Map<SubPatch,FormFactor> formFactors, int side)
      Fills the given form factor map with form factors.
      Parameters:
      formFactors - the form factor array (in/out parameter)
      side - the side of the cube.