Package ke.ric.renderer.api
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..64sunFactor- multiplier for inherited sunlight, finite in 0..64blockFactor- multiplier for captured block illumination and coloured block emitters, finite in 0..64sunDirection- world-space direction from a surface toward the sun, or null to follow rendered timelights- copied list of immutablePointLightorSpotLightvalues
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 Summary
ConstructorsConstructorDescriptionRenderLighting(double ambientFactor, double sunFactor, double blockFactor, LightDirection sunDirection, List<VirtualLight> lights) Constructs a validated immutable value. -
Method Summary
Modifier and TypeMethodDescriptionadd(VirtualLight light) Adds an explicit point or spot light without changing the existing list.ambient(double value) Sets the inherited ambient-light multiplier.doubleReturns the value of theambientFactorrecord component.block(double value) Scales both captured block illumination and coloured block emitters.doubleReturns the value of theblockFactorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisWorld()Reports whether this value exactly preserves inherited world lighting.lights()Returns the value of thelightsrecord component.static RenderLightingstudio()Disables inherited ambient, sunlight and block lighting.sun(double value) Sets the inherited sunlight multiplier.Returns the value of thesunDirectionrecord component.sunDirection(double x, double y, double z) Overrides the direction toward the sun in world coordinates.doubleReturns the value of thesunFactorrecord component.final StringtoString()Returns a string representation of this record class.static RenderLightingworld()Preserves inherited ambient, sunlight and block lighting without adding virtual lights.
-
Constructor Details
-
RenderLighting
public RenderLighting(double ambientFactor, double sunFactor, double blockFactor, LightDirection sunDirection, List<VirtualLight> lights) Constructs a validated immutable value.- Throws:
IllegalArgumentException- if factors, light types or light-count limits are invalidNullPointerException- if lights or an element is null
-
-
Method Details
-
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
Disables inherited ambient, sunlight and block lighting. Add lights explicitly for a studio setup.- Returns:
- lighting with factors 0 and no explicit lights
-
ambient
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
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
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
Overrides the direction toward the sun in world coordinates. The vector is normalized.- Parameters:
x- world X componenty- world Y componentz- world Z component- Returns:
- a new lighting value with fixed sun direction
- Throws:
IllegalArgumentException- if the vector is nonfinite or zero
-
add
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 lightsNullPointerException- 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
ambientFactor
public double ambientFactor()Returns the value of theambientFactorrecord component.- Returns:
- the value of the
ambientFactorrecord component
-
sunFactor
public double sunFactor()Returns the value of thesunFactorrecord component.- Returns:
- the value of the
sunFactorrecord component
-
blockFactor
public double blockFactor()Returns the value of theblockFactorrecord component.- Returns:
- the value of the
blockFactorrecord component
-
sunDirection
Returns the value of thesunDirectionrecord component.- Returns:
- the value of the
sunDirectionrecord component
-
lights
Returns the value of thelightsrecord component.- Returns:
- the value of the
lightsrecord component
-