Class PbrShadingModel
- All Implemented Interfaces:
AutoCloseable
This is the default shading model. It shades PBR assets, such as glTF metallic-roughness materials (see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#metallic-roughness-material), using the map's light (see LightEffect) and environment map (see EnvironmentMapEffect).
- Since:
- 2026.1
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder pre-filled with this shading model's parameters.voidclose()protected voidfinalize()doubleReturns the light intensity used for the PBR lighting, a linear multiplier on the resulting shading.doubleReturns the metallic factor applied to PBR materials.doubleReturns the metallic offset applied to PBR materials.doubleReturns the roughness factor applied to PBR materials.doubleReturns the roughness offset applied to PBR materials.booleanReturns whether PBR shading includes directional lighting.booleanReturns whether a material's unlit property is ignored so that PBR shading is still applied to it.booleanReturns whether PBR shading includes image-based lighting (IBL).static PbrShadingModel.BuilderCreates a new builder with the default PBR parameters.
-
Method Details
-
finalize
protected void finalize()- Overrides:
finalizein classShadingModel
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classShadingModel
-
newBuilder
Creates a new builder with the default PBR parameters.- Returns:
- a new builder.
-
asBuilder
Creates a builder pre-filled with this shading model's parameters.- Returns:
- a builder pre-filled with this shading model's parameters.
-
isDirectionalLightingEnabled
public boolean isDirectionalLightingEnabled()Returns whether PBR shading includes directional lighting.This is lighting coming from the light that is configured on the map. When
true(the default), the map's light (seeLightEffect) adds a directional diffuse and specular contribution to PBR-shaded surfaces.- Returns:
- whether PBR shading includes directional lighting.
- See Also:
-
isImageBasedLightingEnabled
public boolean isImageBasedLightingEnabled()Returns whether PBR shading includes image-based lighting (IBL).When
true(the default), the map's environment map (seeEnvironmentMapEffect) provides ambient and reflection lighting to PBR-shaded surfaces. IBL only contributes when a reflection map is configured on the map.- Returns:
- whether PBR shading includes image-based lighting (IBL).
- See Also:
-
getLightIntensity
public double getLightIntensity()Returns the light intensity used for the PBR lighting, a linear multiplier on the resulting shading.A value of
1(the default) leaves the shading unchanged, values above1brighten it, and values below1darken it. A value of0removes the PBR light contribution entirely. The value must not be negative.- Returns:
- the light intensity used for the PBR lighting.
- See Also:
-
getMetallicFactor
public double getMetallicFactor()Returns the metallic factor applied to PBR materials.The final metallic value is the asset's own metallic (its material factor times any metallic-roughness texture) multiplied by this factor and then increased by the metallic offset. A factor of
1(the default) leaves the asset's own metallic unchanged before the offset is added.- Returns:
- the metallic factor applied to PBR materials.
- See Also:
-
getMetallicOffset
public double getMetallicOffset()Returns the metallic offset applied to PBR materials.- Returns:
- the metallic offset applied to PBR materials.
- See Also:
-
getRoughnessFactor
public double getRoughnessFactor()Returns the roughness factor applied to PBR materials.The final roughness value is the asset's own roughness (its material factor times any metallic-roughness texture) multiplied by this factor and then increased by the roughness offset. A factor of
1(the default) leaves the asset's own roughness unchanged before the offset is added.- Returns:
- the roughness factor applied to PBR materials.
- See Also:
-
getRoughnessOffset
public double getRoughnessOffset()Returns the roughness offset applied to PBR materials.- Returns:
- the roughness offset applied to PBR materials.
- See Also:
-
isIgnoreUnlitPropertyEnabled
public boolean isIgnoreUnlitPropertyEnabled()Returns whether a material's unlit property is ignored so that PBR shading is still applied to it.By default this is
false: a glTF material that carries theKHR_materials_unlitextension is left unshaded, showing only its base color regardless of the map's light. Whentrue, that extension is ignored and the material is shaded like any other PBR material.- Returns:
- whether a material's unlit property is ignored so that PBR shading is still applied to it.
- See Also:
-