API

Class PBRMaterialLoadingAdapter

Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.

Implements

  • IMaterialLoadingAdapter
Index
alphaCutOff ambientOcclusionTexture ambientOcclusionTextureStrength backFaceCulling baseColor baseColorTexture baseDiffuseRoughness baseDiffuseRoughnessTexture baseMetalness baseMetalnessTexture coatColor coatColorTexture coatDarkening coatDarkeningTexture coatIor coatRoughness coatRoughnessAnisotropy coatRoughnessTexture coatWeight coatWeightTexture diffuseTransmissionTint diffuseTransmissionTintTexture emissionColor emissionColorTexture emissionLuminance fuzzColor fuzzColorTexture fuzzRoughness fuzzRoughnessTexture fuzzWeight fuzzWeightTexture geometryCoatNormalTexture geometryCoatNormalTextureScale geometryCoatTangentAngle geometryCoatTangentTexture geometryNormalTexture geometryOpacity geometryTangentAngle geometryTangentTexture geometryThinWalled glossiness isUnlit material refractionBackgroundTexture specularColor specularColorTexture specularIor specularRoughness specularRoughnessAnisotropy specularRoughnessTexture specularWeight specularWeightTexture subsurfaceColor subsurfaceColorTexture subsurfaceRadius subsurfaceRadiusScale subsurfaceScatterAnisotropy subsurfaceWeight subsurfaceWeightTexture thinFilmIor thinFilmThicknessMaximum thinFilmThicknessMinimum thinFilmThicknessTexture thinFilmWeight thinFilmWeightTexture transmissionColor transmissionDepth transmissionDispersionAbbeNumber transmissionDispersionScale transmissionScatter transmissionScatterAnisotropy transmissionScatterTexture transmissionWeight transmissionWeightTexture transparencyAsAlphaCoverage twoSidedLighting unlit useAlphaFromBaseColorTexture useMetallicFromMetallicTextureBlue useRoughnessFromMetallicTextureGreen volumeThickness volumeThicknessTexture
  • get ambientOcclusionTexture(): Nullable<BaseTexture>

    Gets the ambient occlusion texture.

    Returns Nullable<BaseTexture>

    The ambient occlusion texture or null

  • set ambientOcclusionTexture(value: Nullable<BaseTexture>): void

    Sets the ambient occlusion texture (mapped to PBR ambientTexture). Automatically enables grayscale mode when set.

    Parameters

    • value: Nullable<BaseTexture>

      The ambient occlusion texture or null

    Returns void

  • get baseDiffuseRoughnessTexture(): Nullable<BaseTexture>

    Gets the base diffuse roughness texture of the material.

    Returns Nullable<BaseTexture>

    The diffuse roughness texture or null

  • set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>): void

    Sets the base diffuse roughness texture of the material.

    Parameters

    • value: Nullable<BaseTexture>

      The diffuse roughness texture or null

    Returns void

  • get baseMetalnessTexture(): Nullable<BaseTexture>

    Gets the base metalness texture of the material.

    Returns Nullable<BaseTexture>

    The metalness texture or null

  • set baseMetalnessTexture(value: Nullable<BaseTexture>): void

    Sets the base metalness texture of the material (mapped to PBR metallicTexture).

    Parameters

    • value: Nullable<BaseTexture>

      The metalness texture or null

    Returns void

  • set coatColorTexture(value: Nullable<BaseTexture>): void

    Sets the coat color texture (mapped to PBR clearCoat.tintTexture).

    Parameters

    • value: Nullable<BaseTexture>

      The coat color texture or null

    Returns void

  • set coatDarkening(value: number): void

    Sets the coat darkening value. Note: PBR doesn't have a direct coat darkening property, so this is a no-op.

    Parameters

    • value: number

      The coat darkening value (ignored for PBR)

    Returns void

  • get coatRoughnessAnisotropy(): number

    Gets the coat roughness anisotropy. Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.

    Returns number

    Currently returns 0 as clearCoat anisotropy is not yet available

  • set coatRoughnessAnisotropy(value: number): void

    Sets the coat roughness anisotropy. Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.

    Parameters

    • value: number

      The coat anisotropy intensity value (currently ignored)

    Returns void

  • get coatRoughnessTexture(): Nullable<BaseTexture>

    Gets the coat roughness texture.

    Returns Nullable<BaseTexture>

    The coat roughness texture or null

  • set coatRoughnessTexture(value: Nullable<BaseTexture>): void

    Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness). Automatically enables clear coat and disables using roughness from main texture.

    Parameters

    • value: Nullable<BaseTexture>

      The coat roughness texture or null

    Returns void

  • set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>): void

    Sets the subsurface constant tint texture (when using subsurface scattering)

    Parameters

    • value: Nullable<BaseTexture>

      The subsurface constant tint texture or null

    Returns void

  • set fuzzColorTexture(value: Nullable<BaseTexture>): void

    Sets the sheen color texture (mapped to PBR sheen.texture). Automatically enables sheen.

    Parameters

    • value: Nullable<BaseTexture>

      The sheen color texture or null

    Returns void

  • set fuzzRoughnessTexture(value: Nullable<BaseTexture>): void

    Sets the sheen roughness texture (mapped to PBR sheen.textureRoughness). Automatically enables sheen.

    Parameters

    • value: Nullable<BaseTexture>

      The sheen roughness texture or null

    Returns void

  • get geometryCoatNormalTexture(): Nullable<BaseTexture>

    Gets the geometry coat normal texture.

    Returns Nullable<BaseTexture>

    The coat normal texture or null

  • set geometryCoatNormalTexture(value: Nullable<BaseTexture>): void

    Sets the geometry coat normal texture (mapped to PBR clearCoat.bumpTexture). Automatically enables clear coat.

    Parameters

    • value: Nullable<BaseTexture>

      The coat normal texture or null

    Returns void

  • set geometryCoatNormalTextureScale(value: number): void

    Sets the geometry coat normal texture scale.

    Parameters

    • value: number

      The scale value for the coat normal texture

    Returns void

  • set geometryCoatTangentAngle(value: number): void

    Sets the coat tangent angle for anisotropy. Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.

    Parameters

    • value: number

      The coat anisotropy rotation angle in radians (currently ignored)

    Returns void

  • get geometryCoatTangentTexture(): Nullable<BaseTexture>

    Gets the coat tangent texture for anisotropy. Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.

    Returns Nullable<BaseTexture>

    Currently returns null as clearCoat anisotropy is not yet available

  • set geometryCoatTangentTexture(value: Nullable<BaseTexture>): void

    Sets the coat tangent texture for anisotropy. Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.

    Parameters

    • value: Nullable<BaseTexture>

      The coat anisotropy texture (currently ignored)

    Returns void

  • get geometryNormalTexture(): Nullable<BaseTexture>

    Gets the geometry normal texture.

    Returns Nullable<BaseTexture>

    The normal texture or null

  • set geometryNormalTexture(value: Nullable<BaseTexture>): void

    Sets the geometry normal texture (mapped to PBR bumpTexture). Also forces irradiance computation in fragment shader for better lighting.

    Parameters

    • value: Nullable<BaseTexture>

      The normal texture or null

    Returns void

  • set geometryTangentAngle(value: number): void

    Sets the anisotropy rotation (mapped to PBR anisotropy.angle). Automatically enables anisotropy.

    Parameters

    • value: number

      The anisotropy rotation angle in radians

    Returns void

  • get geometryTangentTexture(): Nullable<BaseTexture>

    Gets the geometry tangent texture.

    Returns Nullable<BaseTexture>

    The anisotropy texture or null

  • set geometryTangentTexture(value: Nullable<BaseTexture>): void

    Sets the geometry tangent texture (mapped to PBR anisotropy.texture). Automatically enables anisotropy.

    Parameters

    • value: Nullable<BaseTexture>

      The anisotropy texture or null

    Returns void

  • get glossiness(): number

    Sets/gets the glossiness (inverted roughness) ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active

    Returns number

  • set glossiness(value: number): void

    Sets/gets the glossiness (inverted roughness) ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active

    Parameters

    • value: number

    Returns void

  • get refractionBackgroundTexture(): Nullable<BaseTexture>

    Gets the refraction background texture

    Returns Nullable<BaseTexture>

    The refraction background texture or null

  • set refractionBackgroundTexture(value: Nullable<BaseTexture>): void

    Sets the refraction background texture

    Parameters

    • value: Nullable<BaseTexture>

      The refraction background texture or null

    Returns void

  • get specularRoughnessTexture(): Nullable<BaseTexture>

    Gets the specular roughness texture.

    Returns Nullable<BaseTexture>

    The roughness texture (same as metallic texture for PBR) or null

  • set specularRoughnessTexture(value: Nullable<BaseTexture>): void

    Sets the specular roughness texture. Note: PBR uses the same texture for both metallic and roughness, so this only sets the texture if no base metalness texture exists.

    Parameters

    • value: Nullable<BaseTexture>

      The roughness texture or null

    Returns void

  • get specularWeightTexture(): Nullable<BaseTexture>

    Gets the specular weight texture.

    Returns Nullable<BaseTexture>

    The specular weight texture or null

  • set specularWeightTexture(value: Nullable<BaseTexture>): void

    Sets the specular weight texture (mapped to PBR metallicReflectanceTexture). Configures the material to use only metalness from this texture when set.

    Parameters

    • value: Nullable<BaseTexture>

      The specular weight texture or null

    Returns void

  • set subsurfaceColorTexture(value: Nullable<BaseTexture>): void

    Sets the subsurface color texture.

    Parameters

    • value: Nullable<BaseTexture>

      The subsurface tint texture or null

    Returns void

  • get subsurfaceRadius(): number

    Gets the subsurface radius (used for subsurface scattering) subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.

    Returns number

    The subsurface radius as a Color3

  • set subsurfaceRadius(value: number): void

    Sets the subsurface radius (used for subsurface scattering) subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.

    Parameters

    • value: number

      The subsurface radius as a number

    Returns void

  • get subsurfaceRadiusScale(): Color3

    Gets the subsurface radius scale (used for subsurface scattering) subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.

    Returns Color3

    The subsurface radius scale as a Color3

  • set subsurfaceRadiusScale(value: Color3): void

    Sets the subsurface radius scale (used for subsurface scattering) subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.

    Parameters

    • value: Color3

      The subsurface radius scale as a Color3

    Returns void

  • set subsurfaceScatterAnisotropy(value: number): void

    Sets the subsurface scattering anisotropy. Note: PBRMaterial does not have a direct equivalent, so this is a no-op.

    Parameters

    • value: number

      The anisotropy intensity value (ignored for PBR)

    Returns void

  • set thinFilmThicknessMaximum(value: number): void

    Sets the iridescence thickness maximum (mapped to PBR iridescence.maximumThickness).

    Parameters

    • value: number

      The maximum thickness value in nanometers

    Returns void

  • set thinFilmThicknessMinimum(value: number): void

    Sets the iridescence thickness minimum (mapped to PBR iridescence.minimumThickness).

    Parameters

    • value: number

      The minimum thickness value in nanometers

    Returns void

  • set thinFilmThicknessTexture(value: Nullable<BaseTexture>): void

    Sets the iridescence thickness texture (mapped to PBR iridescence.thicknessTexture).

    Parameters

    • value: Nullable<BaseTexture>

      The iridescence thickness texture or null

    Returns void

  • set thinFilmWeight(value: number): void

    Sets the iridescence weight (mapped to PBR iridescence.intensity). Automatically enables iridescence.

    Parameters

    • value: number

      The iridescence intensity value

    Returns void

  • set thinFilmWeightTexture(value: Nullable<BaseTexture>): void

    Sets the thin film weight texture (mapped to PBR iridescence.texture).

    Parameters

    • value: Nullable<BaseTexture>

      The thin film weight texture or null

    Returns void

  • set transmissionWeightTexture(value: Nullable<BaseTexture>): void

    Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture). Automatically enables refraction and glTF-style textures.

    Parameters

    • value: Nullable<BaseTexture>

      The transmission weight texture or null

    Returns void

  • set useMetallicFromMetallicTextureBlue(value: boolean): void

    Sets whether to use metalness from the metallic texture's blue channel.

    Parameters

    • value: boolean

      True to use blue channel for metalness

    Returns void

  • set useRoughnessFromMetallicTextureGreen(value: boolean): void

    Sets whether to use roughness from the metallic texture's green channel. Also disables using roughness from the alpha channel when enabled.

    Parameters

    • value: boolean

      True to use green channel for roughness

    Returns void

  • set volumeThickness(value: number): void

    Sets the thickness factor (mapped to PBR subSurface.maximumThickness). Automatically enables refraction.

    Parameters

    • value: number

      The thickness value

    Returns void

  • set volumeThicknessTexture(value: Nullable<BaseTexture>): void

    Sets the thickness texture (mapped to PBR subSurface.thicknessTexture). Automatically enables refraction.

    Parameters

    • value: Nullable<BaseTexture>

      The thickness texture or null

    Returns void

  • Configures glTF-style anisotropy for the material. Note: PBR materials don't need this configuration, so this is a no-op.

    Parameters

    • useGltfStyle: boolean = true

      Whether to use glTF-style anisotropy (ignored for PBR)

    Returns void

  • Configures transmission for thin-surface transmission (KHR_materials_transmission). Sets up the material for proper thin-surface transmission behavior.

    Returns void

  • Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.

    Parameters

    • enableEdgeColor: boolean = false

      Whether to enable OpenPBR BRDF models for edge color support

    Returns void

  • Sets the normal map inversions for the material.

    Parameters

    • invertX: boolean

      Whether to invert the normal map on the X axis

    • invertY: boolean

      Whether to invert the normal map on the Y axis

    Returns void