Class PbrShadingModel.Builder

java.lang.Object
com.luciad.layers.styles.PbrShadingModel.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
PbrShadingModel

public static final class PbrShadingModel.Builder extends Object implements AutoCloseable
Since:
2026.1
  • Constructor Details

    • Builder

      public Builder(@NotNull PbrShadingModel.Builder other)
      Copy constructor.
      Parameters:
      other - the builder to copy.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • directionalLighting

      @NotNull public PbrShadingModel.Builder directionalLighting(boolean directional)
      Sets whether the map's configured light contributes direct lighting to PBR materials.

      This is optional. The default value is true.

      Parameters:
      directional - whether the map's configured light contributes direct lighting to PBR materials.
      Returns:
      this builder.
    • imageBasedLighting

      @NotNull public PbrShadingModel.Builder imageBasedLighting(boolean imageBasedLighting)
      Sets whether PBR materials are lit by image-based lighting (IBL) from the map's environment map.

      This is optional. The default value is true. IBL only contributes when a reflection map is configured on the map (see EnvironmentMapEffect). Set this to false to get the raw direct-only look.

      Parameters:
      imageBasedLighting - whether PBR materials are lit by image-based lighting.
      Returns:
      this builder.
    • lightIntensity

      @NotNull public PbrShadingModel.Builder lightIntensity(double lightIntensity) throws IllegalArgumentException
      Sets the light intensity used for the PBR lighting, a linear multiplier on the resulting shading.

      This is optional. The default value is 1, which leaves the shading unchanged. Values above 1 brighten the shading and values below 1 darken it: 2 is twice as bright and 0.5 is half as bright. A value of 0 removes the PBR light contribution entirely.

      Parameters:
      lightIntensity - the light intensity multiplier applied to PBR-shaded surfaces. Must not be negative.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the light intensity is negative.
    • metallic

      @NotNull public PbrShadingModel.Builder metallic(double factor, double offset)
      Sets the metallic factor and offset applied to PBR materials.

       metallic = clamp(assetMetallic * factor + offset, 0, 1)
       

      assetMetallic is the asset's own metallic: its material factor times any metallic-roughness texture. Setting the metallic is optional. Without it the factor is 1 and the offset is 0, which leave the asset's own metallic unchanged.

      Parameters:
      factor - the factor by which the asset's metallic is multiplied.
      offset - the offset added after scaling by the factor. Defaults to 0.
      Returns:
      this builder.
    • metallic

      @NotNull public PbrShadingModel.Builder metallic(double factor)
      Sets the metallic factor and offset applied to PBR materials.

       metallic = clamp(assetMetallic * factor + offset, 0, 1)
       

      assetMetallic is the asset's own metallic: its material factor times any metallic-roughness texture. Setting the metallic is optional. Without it the factor is 1 and the offset is 0, which leave the asset's own metallic unchanged.

      Parameters:
      factor - the factor by which the asset's metallic is multiplied.
      Returns:
      this builder.
    • roughness

      @NotNull public PbrShadingModel.Builder roughness(double factor, double offset)
      Sets the roughness factor and offset applied to PBR materials.

       roughness = clamp(assetRoughness * factor + offset, 0, 1)
       

      assetRoughness is the asset's own roughness: its material factor times any metallic-roughness texture. Setting the roughness is optional. Without it the factor is 1 and the offset is 0, which leave the asset's own roughness unchanged.

      Parameters:
      factor - the factor by which the asset's roughness is multiplied.
      offset - the offset added after scaling by the factor. Defaults to 0.
      Returns:
      this builder.
    • roughness

      @NotNull public PbrShadingModel.Builder roughness(double factor)
      Sets the roughness factor and offset applied to PBR materials.

       roughness = clamp(assetRoughness * factor + offset, 0, 1)
       

      assetRoughness is the asset's own roughness: its material factor times any metallic-roughness texture. Setting the roughness is optional. Without it the factor is 1 and the offset is 0, which leave the asset's own roughness unchanged.

      Parameters:
      factor - the factor by which the asset's roughness is multiplied.
      Returns:
      this builder.
    • ignoreUnlitProperty

      @NotNull public PbrShadingModel.Builder ignoreUnlitProperty(boolean ignoreUnlitProperty)
      Sets whether a material's unlit property is ignored so that PBR shading is still applied to it.

      This is optional. The default value is false: a glTF material that carries the KHR_materials_unlit extension is left unshaded, showing only its base color regardless of the map's light. Set this to true to ignore that extension and shade the material like any other PBR material, for example when the unlit property in the source data is not wanted.

      Parameters:
      ignoreUnlitProperty - whether a material's unlit property is ignored so that PBR shading is still applied to it.
      Returns:
      this builder.
    • build

      @NotNull public PbrShadingModel build() throws IllegalStateException
      Builds the PBR shading model.
      Returns:
      the built PBR shading model.
      Throws:
      IllegalStateException - if both directional lighting and image-based lighting are disabled, as PBR shading then contributes nothing. Use SimpleShadingModel, or pass no shading model, to shade without either.