magic-pixels
    Preparing search index...

    Type Alias PbrMaterialOptions

    Options of createPbrMaterial. Every factor defaults to its glTF default, every map is optional. Colour factors are linear RGB in 0..1 (a Color is converted); base colour and emissive maps should be created with colorSpace: 'srgb', the other maps hold linear data.

    type PbrMaterialOptions = {
        alphaCutoff?: number;
        alphaMode?: AlphaMode;
        baseColorFactor?: Color | number[];
        baseColorMap?: PbrMap;
        doubleSided?: boolean;
        emissiveFactor?: Color | number[];
        emissiveMap?: PbrMap;
        linearOutput?: boolean;
        maxDirectionalLights?: number;
        maxPointLights?: number;
        metallicFactor?: number;
        metallicRoughnessMap?: PbrMap;
        normalMap?: PbrMap;
        normalScale?: number;
        occlusionMap?: PbrMap;
        occlusionStrength?: number;
        roughnessFactor?: number;
        tangents?: boolean;
        unlit?: boolean;
        vertexColors?: boolean;
    }
    Index
    alphaCutoff?: number

    threshold for 'mask', default 0.5

    alphaMode?: AlphaMode

    'opaque' ignores the base colour's alpha (the default), 'mask' discards fragments with an alpha below alphaCutoff, 'blend' makes the material transparent.

    baseColorFactor?: Color | number[]

    linear RGBA multiplied into the base colour, default [1, 1, 1, 1]

    baseColorMap?: PbrMap

    sRGB texture multiplied into the base colour

    doubleSided?: boolean

    Draw both faces (side: 'double') and flip the normal for back faces. Default false: back faces are culled (side: 'front'), as glTF specifies.

    emissiveFactor?: Color | number[]

    linear RGB added after lighting, default [0, 0, 0]

    emissiveMap?: PbrMap

    sRGB texture multiplied into the emissive factor

    linearOutput?: boolean

    Write the linear colour as it is instead of converting it to sRGB. For a material drawn into a render target that a later pass (see createToneMapMaterial) tone maps and converts. Default false.

    maxDirectionalLights?: number

    size of the directional light arrays in the shader, default 4

    maxPointLights?: number

    size of the point light arrays in the shader, default 4

    metallicFactor?: number

    0 for a dielectric, 1 for a metal, default 1

    metallicRoughnessMap?: PbrMap

    roughness in the green channel, metalness in the blue channel

    normalMap?: PbrMap

    tangent-space normals, 0..1 encoded

    normalScale?: number

    scales the x and y of the sampled normal, default 1

    occlusionMap?: PbrMap

    ambient occlusion in the red channel

    occlusionStrength?: number

    how much of the occlusion map applies, 0..1, default 1

    roughnessFactor?: number

    0 for a mirror, 1 for chalk, default 1

    tangents?: boolean

    The geometry has a tangent attribute (vec4, bitangent handedness in w) for the normal map. Without it, the tangent is reconstructed from screen-space derivatives in the fragment shader.

    unlit?: boolean

    base colour only, no lighting (glTF's KHR_materials_unlit)

    vertexColors?: boolean

    multiply the base colour by the color vertex attribute (vec3 or vec4)