Package limn.render3d

Record Class Environment

java.lang.Object
java.lang.Record
limn.render3d.Environment

public record Environment(Vec3 sky, Vec3 horizon, Vec3 ground, float intensity) extends Record
An image-based lighting environment as a procedural gradient sky: sky straight up, horizon at the equator, ground straight down, in linear color, scaled by intensity. It drives diffuse irradiance (baked to spherical harmonics; see IrradianceSh), analytic specular reflections in the PBR shader, and the skybox background. A full HDR/equirect loader can replace the analytic sky later without changing the shading path.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Environment(Vec3 sky, Vec3 horizon, Vec3 ground, float intensity)
    Creates an instance of a Environment record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    gradient(Vec3 sky, Vec3 horizon, Vec3 ground)
    A three-stop sky gradient used as ambient light, in linear units.
    Returns the value of the ground record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the horizon record component.
    float
    Returns the value of the intensity record component.
    intensity(float intensity)
    Scales the whole environment's contribution; 1 leaves it as authored.
    radiance(Vec3 direction)
    Incoming radiance from direction (need not be normalized).
    sky()
    Returns the value of the sky record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Environment

      public Environment(Vec3 sky, Vec3 horizon, Vec3 ground, float intensity)
      Creates an instance of a Environment record class.
      Parameters:
      sky - the value for the sky record component
      horizon - the value for the horizon record component
      ground - the value for the ground record component
      intensity - the value for the intensity record component
  • Method Details

    • gradient

      public static Environment gradient(Vec3 sky, Vec3 horizon, Vec3 ground)
      A three-stop sky gradient used as ambient light, in linear units.
    • intensity

      public Environment intensity(float intensity)
      Scales the whole environment's contribution; 1 leaves it as authored.
    • radiance

      public Vec3 radiance(Vec3 direction)
      Incoming radiance from direction (need not be normalized).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sky

      public Vec3 sky()
      Returns the value of the sky record component.
      Returns:
      the value of the sky record component
    • horizon

      public Vec3 horizon()
      Returns the value of the horizon record component.
      Returns:
      the value of the horizon record component
    • ground

      public Vec3 ground()
      Returns the value of the ground record component.
      Returns:
      the value of the ground record component
    • intensity

      public float intensity()
      Returns the value of the intensity record component.
      Returns:
      the value of the intensity record component