Module raytracer

Class Environment

java.lang.Object
de.grogra.ray.physics.Environment
Direct Known Subclasses:
ShadingEnvironment

public class Environment extends Object
This class serves as input to scattering calculations. The fields together constitute the local environment at a surface, light or sensor point, including geometrical and optical properties.
Author:
Ole Kniemeyer
  • Field Details

    • STANDARD_RAY_TRACER

      public static final int STANDARD_RAY_TRACER
      Constant for type indicating a standard (unphysical) ray tracer algorithm.
      See Also:
    • PATH_TRACER

      public static final int PATH_TRACER
      Constant for type indicating a path tracer algorithm.
      See Also:
    • RADIATION_MODEL

      public static final int RADIATION_MODEL
      Constant for type indicating a radiation model algorithm.
      See Also:
    • type

      public final int type
      The type of algorithm for which this environment is used, one of STANDARD_RAY_TRACER, PATH_TRACER, RADIATION_MODEL.
    • bounds

      public final BoundingBox bounds
      The bounding box of all finite volumes of the scene in which this environment is used.
      See Also:
    • boundsCenter

      public final Vector3d boundsCenter
      The center of bounds.
    • boundsRadius

      public final double boundsRadius
      The radius of the bounding sphere whose center is located at boundsCenter and which encloses bounds.
    • localToGlobal

      public Matrix4f localToGlobal
      The transformation from local to global coordinates. This is only used for the emitter-specific methods. The local coordinates are those of the object which defines the emitter (light source or sensor).
    • globalToLocal

      public Matrix4f globalToLocal
      The transformation from global to local coordinates. This has to be the inverse of localToGlobal.
    • localPoint

      public final Point3f localPoint
      The surface position in local coordinates of the object which defines the surface, light source, or sensor.
    • point

      public final Point3f point
      The surface position in global world coordinates.
    • normal

      public final Vector3f normal
      The surface geometric normal unit vector at point in global world coordinates. This is always the outer normal vector.

      The normal vector is only needed for surface shaders, it is not used for emitters (light sources or sensors).

    • uv

      public final Point2f uv
      The canonical uv-coordinates at point. Which coordinates are canonical for a specific surface depends on the surface: E.g., for a sphere, the canonical uv-coordinates would be spherical coordinates.
    • dpdu

      public final Vector3f dpdu
      The derivative of the global surface position with respect to the canonical u-coordinate.
    • dpdv

      public final Vector3f dpdv
      The derivative of the global surface position with respect to the canonical v-coordinate.
    • solid

      public boolean solid
      Indicates whether this is an intersection at the surface of a solid object or of an infinitely thin object.
    • iorRatio

      public float iorRatio
      The index-of-refraction ratio at the surface. This is the index of refraction of the surface side where the normal vector points into, divided by the index of refraction of the opposite side.
    • userMatrix

      public final Matrix3f userMatrix
      This matrix may be used freely in implementations of the Scattering methods.
    • userMatrix2

      public final Matrix3f userMatrix2
      This matrix may be used freely in implementations of the Scattering methods.
    • userMatrix3

      public final Matrix3f userMatrix3
      This matrix may be used freely in implementations of the Scattering methods.
    • userVector

      public final Vector3f userVector
      This vector may be used freely in implementations of the Scattering methods.
    • userVector2

      public final Vector3f userVector2
      This vector may be used freely in implementations of the Scattering methods.
    • userVector3

      public final Vector3f userVector3
      This vector may be used freely in implementations of the Scattering methods.
    • userVector4

      public final Vector3f userVector4
      This vector may be used freely in implementations of the Scattering methods.
    • tmpPoint0

      public final Point3d tmpPoint0
      This point may be used freely in implementations of the Scattering methods.
    • tmpPoint1

      public final Point3d tmpPoint1
      This point may be used freely in implementations of the Scattering methods.
    • tmpVector0

      public final Vector3d tmpVector0
      This vector may be used freely in implementations of the Scattering methods.
    • tmpVector1

      public final Vector3d tmpVector1
      This vector may be used freely in implementations of the Scattering methods.
    • tmpPoint2d0

      public final Point2d tmpPoint2d0
      This point may be used freely in implementations of the Scattering methods.
    • tmpMatrix30

      public final Matrix3d tmpMatrix30
      This matrix may be used freely in implementations of the Scattering methods.
    • tmpSpectrum0

      public final Spectrum tmpSpectrum0
      This spectrum may be used freely in implementations of the Scattering methods.
    • tmpSpectrum1

      public final Spectrum tmpSpectrum1
      This spectrum may be used freely in implementations of the Scattering methods.
    • userObjectOwner

      public Object userObjectOwner
      The current owner of userObject. This should be used to determine the validity of caching information stored in userObject.
    • userObject

      public Object userObject
      This object may be used freely in implementations of the Scattering methods in order to cache results between invocations. Whenever this field is modified, userObjectOwner has to be set, too.
  • Constructor Details

    • Environment

      public Environment()
    • Environment

      public Environment(BoundingBox bounds, Spectrum factory, int type)
      Creates a new instance of Environment. The factory is used to obtain new spectra for light transport computations.
      Parameters:
      bounds - bounding box of scene in which environment is used
      factory - use this to create new spectra
      type - value for type
  • Method Details