Module raytracer

Class PhotonMap

java.lang.Object
de.grogra.ray2.photonmap.PhotonMap

public class PhotonMap extends Object
This class provides a photon map. The photon map uses a kd-tree data structure for fast access.
Author:
Ralf Kopsch
  • Constructor Details

    • PhotonMap

      public PhotonMap(double photonArea)
      Creates a new Photon Map.
      Parameters:
      photonArea - the scanning area.
  • Method Details

    • insertPhoton

      public void insertPhoton(Color3f col, Point3d pos, Vector3f dir)
      Inserts a new Photon into this map.
      Parameters:
      col - The Photon color.
      pos - The Photon position.
      dir - The Photon impact direction.
    • sumPhotons

      public void sumPhotons(Point3d point, Vector3f normal, Tuple3d color)
      Calculates the color for the given point.
      Parameters:
      point - the impact point.
      normal - the impact normal vector.
      color - output - the calculated color
    • traceRay

      public float traceRay(Intersection desc, Tuple3d color)
      This is only a debug function. It direct visualise the photon map.
      Parameters:
      desc - the intersection description
      color - output - the calculated color
      Returns:
      transparent value
    • getEntryCount

      public int getEntryCount()
      Returns the number of photon map entries.
      Returns:
      Returns the number of photon map entries.