Record Class RenderLayer

java.lang.Object
java.lang.Record
ke.ric.renderer.api.RenderLayer
Record Components:
entityOnly - whether only selected entity-owned pixels contribute to the final composition
selector - predicate over copied entity metadata
brightness - finite nonnegative post-render RGB multiplier; 1 preserves brightness
opacity - composition opacity in 0..1; 1 is fully opaque
content - additional selection, or null to inherit request content
environment - per-field overrides, or null to inherit request environment
appearance - per-field overrides, or null to inherit request appearance
lighting - complete replacement lighting, or null to inherit request lighting
occlusion - visibility of selected entities relative to other captured geometry
color - pixel colour treatment, applied before brightness and opacity

public record RenderLayer(boolean entityOnly, EntitySelector selector, double brightness, double opacity, SceneContent content, RenderEnvironment environment, RenderAppearance appearance, RenderLighting lighting, Occlusion occlusion, LayerColor color) extends Record
One immutable pass in a RenderRecipe. Use scene() for a full-scene base and entities(EntitySelector) for a selected-entity overlay. Every pass derives independently from the same original capture; a preceding pass never changes a later pass's source evidence.

Unspecified content, environment, appearance and lighting inherit the request. Content can only narrow the request's selection. Environment and appearance inherit individual unspecified fields; explicit lighting replaces the complete light setup. Capture exclusions and viewer privacy remain authoritative in every pass.

Entity layers respect scene occlusion by default. Use Occlusion.SELECTED_ONLY explicitly for Xray visibility; selected entities still obscure each other. Primary-camera selection does not itself remove hidden geometry's lighting or shadows. Layer colour is applied to rendered pixels first, then brightness, then opacity during ordered composition.

  • Constructor Details

    • RenderLayer

      public RenderLayer(boolean entityOnly, EntitySelector selector, double brightness, double opacity, SceneContent content, RenderEnvironment environment, RenderAppearance appearance, RenderLighting lighting, Occlusion occlusion, LayerColor color)
      Constructs a validated immutable value.
      Throws:
      IllegalArgumentException - for invalid brightness or opacity
      NullPointerException - if selector, occlusion or color is null
    • RenderLayer

      public RenderLayer(boolean entityOnly, EntitySelector selector, double brightness, double opacity)
      Creates a layer with inherited request controls, original colours and normal scene occlusion.
      Parameters:
      entityOnly - whether only selected entity-owned pixels contribute
      selector - entity selection over copied metadata
      brightness - finite nonnegative post-render multiplier
      opacity - composition opacity in 0..1
  • Method Details

    • scene

      public static RenderLayer scene()
      Creates a full-scene layer with original colours, brightness 1 and opacity 1.
      Returns:
      a layer inheriting request controls
    • entities

      public static RenderLayer entities(EntitySelector selector)
      Creates a selected-entity layer that respects other scene geometry by default. Native object-ID evidence determines which pixels belong to the selected entities.
      Parameters:
      selector - entity selection over copied metadata
      Returns:
      an entity layer with original colours, brightness 1 and opacity 1
    • brightness

      public RenderLayer brightness(double value)
      Sets a post-render RGB multiplier, after colour treatment and before opacity. This differs from exposure, which changes renderer appearance, and from light intensity, which lights surfaces.
      Parameters:
      value - finite multiplier at least 0; default 1
      Returns:
      a new layer with this setting
    • opacity

      public RenderLayer opacity(double value)
      Sets how strongly this layer is composited over earlier layers.
      Parameters:
      value - finite opacity from 0 (invisible) to 1 (opaque)
      Returns:
      a new layer with this setting
    • content

      public RenderLayer content(SceneContent value)
      Narrows request content for this pass without changing the original capture. Removed geometry is unavailable to camera, reflection and shadow rays. Use entity selection and occlusion to restrict camera output while retaining the surrounding scene geometry.
      Parameters:
      value - selection to intersect with request content, or null to inherit
      Returns:
      a new layer with this setting
    • environment

      public RenderLayer environment(RenderEnvironment value)
      Sets per-field rendered time/weather overrides for this pass. Unset fields inherit the request.
      Parameters:
      value - overrides, or null to inherit
      Returns:
      a new layer with this setting
    • appearance

      public RenderLayer appearance(RenderAppearance value)
      Sets per-field appearance overrides for this pass, such as renderer exposure.
      Parameters:
      value - overrides, or null to inherit
      Returns:
      a new layer with this setting
    • lighting

      public RenderLayer lighting(RenderLighting value)
      Replaces the complete light setup for this pass. This value does not merge light lists.
      Parameters:
      value - lighting setup, or null to inherit request lighting
      Returns:
      a new layer with this setting
    • occlusion

      public RenderLayer occlusion(Occlusion value)
      Selects whether other captured geometry occludes the selected entities. Selected entities always occlude each other; lighting geometry remains available.
      Parameters:
      value - RESPECT_SCENE by default, or explicit SELECTED_ONLY for Xray
      Returns:
      a new layer with this setting
    • color

      public RenderLayer color(LayerColor value)
      Sets the RGB treatment applied before this layer's brightness and opacity.
      Parameters:
      value - original colour, multiplicative tint or solid colour
      Returns:
      a new layer with this setting
    • 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.
    • entityOnly

      public boolean entityOnly()
      Returns the value of the entityOnly record component.
      Returns:
      the value of the entityOnly record component
    • selector

      public EntitySelector selector()
      Returns the value of the selector record component.
      Returns:
      the value of the selector record component
    • brightness

      public double brightness()
      Returns the value of the brightness record component.
      Returns:
      the value of the brightness record component
    • opacity

      public double opacity()
      Returns the value of the opacity record component.
      Returns:
      the value of the opacity record component
    • content

      public SceneContent content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • environment

      public RenderEnvironment environment()
      Returns the value of the environment record component.
      Returns:
      the value of the environment record component
    • appearance

      public RenderAppearance appearance()
      Returns the value of the appearance record component.
      Returns:
      the value of the appearance record component
    • lighting

      public RenderLighting lighting()
      Returns the value of the lighting record component.
      Returns:
      the value of the lighting record component
    • occlusion

      public Occlusion occlusion()
      Returns the value of the occlusion record component.
      Returns:
      the value of the occlusion record component
    • color

      public LayerColor color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component