Taos API Reference
    Preparing search index...

    Class OpenPbrMaterial

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name?: string

    Optional human-readable name (e.g. the source glTF material name). Display only — the editor surfaces it in the Inspector; the renderer never keys on it.

    transparent: boolean = false

    True for alpha-blended materials. ForwardPass routes these through its transparent sub-pass (after opaque) with depth-write disabled.

    cullMode: GPUCullMode = 'back'

    Face-culling mode used when a pass builds this material's render pipeline: 'back' (default) culls back faces, 'front' culls front faces, 'none' draws both sides. A per-draw doubleSided flag (e.g. mixed-winding tile content) forces 'none' regardless of this setting. Passes fold this into their pipeline cache key, so it may differ between instances sharing a shaderId.

    depthBias: number = 0

    Constant polygon depth-bias applied when a pass builds this material's render pipeline. A positive value nudges this material's fragments toward the camera (the pass multiplies it by RenderContext.depthBiasSign so the sign is correct under standard- or reversed-Z), so coincident geometry drawn on top of other surfaces — draped vector overlays / decals sitting exactly on terrain — wins the depth test instead of Z-fighting. 0 (default) adds no bias. Units follow WebGPU depthBias (depth-buffer units; for a float depth target the effective offset scales with the fragment's exponent, so depthBiasSlopeScale is usually the more robust knob). Passes fold it into their pipeline cache key, so it may differ between instances sharing a shaderId.

    depthBiasSlopeScale: number = 0

    Slope-scaled companion to depthBias (WebGPU depthBiasSlopeScale): bias proportional to the polygon's depth slope, so steeply-angled draped geometry gets more offset where it needs it (grazing angles) and less where it doesn't. Same toward-the-camera sign convention as depthBias. 0 (default) = no slope bias. Also part of the pipeline cache key.

    shaderId: string = 'openpbr'

    Stable per-subclass identifier. All instances with the same shaderId MUST produce identical getShaderCode output and identical getBindGroupLayout layouts on a given device — the pass uses this as the pipeline cache key.

    baseWeight: number
    baseColor: [number, number, number]
    baseMetalness: number
    baseDiffuseRoughness: number
    specularWeight: number
    specularColor: [number, number, number]
    specularRoughness: number
    specularIor: number
    specularAnisotropy: number
    specularRotation: number
    coatWeight: number
    coatColor: [number, number, number]
    coatRoughness: number
    coatIor: number
    coatDarkening: number
    fuzzWeight: number
    fuzzColor: [number, number, number]
    fuzzRoughness: number
    subsurfaceWeight: number
    subsurfaceColor: [number, number, number]
    thinFilmWeight: number
    thinFilmThickness: number
    thinFilmIor: number
    emissionLuminance: number
    emissionColor: [number, number, number]
    transmissionWeight: number

    Refractive transmission strength (glass). Default 0. Rendered by the forward TransmissionPass; not part of the forward/geometry uniform.

    thickness: number

    Volume thickness (Beer-Lambert). Default 0.

    attenuationColor: [number, number, number]

    Beer-Lambert absorption color. Default [1,1,1].

    attenuationDistance: number

    Absorption distance. Default Infinity.

    dispersion: number

    Chromatic dispersion. Default 0.

    opacity: number
    normalScale: number
    unlit: boolean
    transmissionMap?: Texture

    Per-pixel transmission/thickness maps — read by the TransmissionPass, not part of this material's group-2 bind group.

    thicknessMap?: Texture

    Accessors

    • get texTransforms(): (PerTextureUvTransform | null)[] | undefined

      The per-texture UV transforms reconstructed from the packed table (slot order: baseColor, normal, MER, emissive, coatNormal, anisotropy), or undefined when the material uses no per-texture transform. Empty slots come back as identity (offset 0, scale 1, rotation 0).

      Returns (PerTextureUvTransform | null)[] | undefined

    Methods