Record Class RenderLighting

java.lang.Object
java.lang.Record
ke.ric.renderer.api.RenderLighting
Record Components:
ambientFactor - multiplier for inherited ambient light, finite in 0..64
sunFactor - multiplier for inherited sunlight, finite in 0..64
blockFactor - multiplier for captured block illumination and coloured block emitters, finite in 0..64
sunDirection - world-space direction from a surface toward the sun, or null to follow rendered time
lights - copied list of immutable PointLight or SpotLight values

public record RenderLighting(double ambientFactor, double sunFactor, double blockFactor, LightDirection sunDirection, List<VirtualLight> lights) extends Record
Immutable lighting for a request or one recipe layer. Every modifier returns a new value. world() preserves the existing inherited lighting path. studio() starts with ambient, sunlight and captured block lighting disabled, ready for explicit lights.

Entity-layer selection and occlusion can restrict primary-camera output while retaining surrounding geometry for lighting and shadows. Geometry excluded by SceneContent is instead removed from all rays. Capture exclusions and viewer privacy remove evidence before it can influence rendering. Explicit lights and requested hard shadows are supported in every advertised quality profile by the matching provider.

Limits are per render pass: at most 16 virtual lights, eight casting shadows, range at most 64 blocks and factors/intensity from 0 to 64. Check RendererClient.lightingCapabilities() for the active provider. Unsupported controls or lower provider limits fail explicitly.

  • Constructor Details

  • Method Details

    • world

      public static RenderLighting world()
      Preserves inherited ambient, sunlight and block lighting without adding virtual lights.
      Returns:
      lighting with factors 1, automatic sun direction and no explicit lights
    • studio

      public static RenderLighting studio()
      Disables inherited ambient, sunlight and block lighting. Add lights explicitly for a studio setup.
      Returns:
      lighting with factors 0 and no explicit lights
    • ambient

      public RenderLighting ambient(double value)
      Sets the inherited ambient-light multiplier. This does not scale explicit lights.
      Parameters:
      value - finite factor in 0..64; 0 disables ambient light
      Returns:
      a new lighting value
      Throws:
      IllegalArgumentException - if value is outside the finite range
    • sun

      public RenderLighting sun(double value)
      Sets the inherited sunlight multiplier. Its direction follows rendered time unless overridden.
      Parameters:
      value - finite factor in 0..64; 0 disables sunlight
      Returns:
      a new lighting value
      Throws:
      IllegalArgumentException - if value is outside the finite range
    • block

      public RenderLighting block(double value)
      Scales both captured block illumination and coloured block emitters. Explicit virtual lights are independent of this control.
      Parameters:
      value - finite factor in 0..64; 0 disables inherited block lighting
      Returns:
      a new lighting value
      Throws:
      IllegalArgumentException - if value is outside the finite range
    • sunDirection

      public RenderLighting sunDirection(double x, double y, double z)
      Overrides the direction toward the sun in world coordinates. The vector is normalized.
      Parameters:
      x - world X component
      y - world Y component
      z - world Z component
      Returns:
      a new lighting value with fixed sun direction
      Throws:
      IllegalArgumentException - if the vector is nonfinite or zero
    • add

      public RenderLighting add(VirtualLight light)
      Adds an explicit point or spot light without changing the existing list.
      Parameters:
      light - immutable light to append
      Returns:
      a new lighting value
      Throws:
      IllegalArgumentException - for unsupported light implementations, more than 16 lights or more than eight shadow lights
      NullPointerException - if light is null
    • isWorld

      public boolean isWorld()
      Reports whether this value exactly preserves inherited world lighting.
      Returns:
      true for factors 1, automatic sun direction and no explicit lights
    • 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.
    • ambientFactor

      public double ambientFactor()
      Returns the value of the ambientFactor record component.
      Returns:
      the value of the ambientFactor record component
    • sunFactor

      public double sunFactor()
      Returns the value of the sunFactor record component.
      Returns:
      the value of the sunFactor record component
    • blockFactor

      public double blockFactor()
      Returns the value of the blockFactor record component.
      Returns:
      the value of the blockFactor record component
    • sunDirection

      public LightDirection sunDirection()
      Returns the value of the sunDirection record component.
      Returns:
      the value of the sunDirection record component
    • lights

      public List<VirtualLight> lights()
      Returns the value of the lights record component.
      Returns:
      the value of the lights record component