Class PhysicalMaterial

Hierarchy (view full)

Implements

Constructors

Properties

alphaMap: null | ITexture = null

Managed internally, do not change manually

assetType: "material" = ...
bumpMap: null | ITexture = null
constructor: typeof PhysicalMaterial
displacementMap: null | ITexture = null
extraUniformsToUpload: Record<string, IUniform<any>> = {}
generator?: IMaterialGenerator

Managed internally, do not change manually

isPhysicalMaterial: true = true
map: null | ITexture = null
materialExtensions: MaterialExtension[] = []
metalnessMap: null | ITexture = null
normalMap: null | ITexture = null
onAfterRender: ((renderer, scene, camera, geometry, object) => void) = ...

Type declaration

registerMaterialExtensions: ((this, customMaterialExtensions) => void) = iMaterialCommons.registerMaterialExtensions

Type declaration

roughnessMap: null | ITexture = null
setDirty: ((this, options?) => void) = iMaterialCommons.setDirty

Type declaration

uiConfig: UiObjectConfig<any, string, any> = ...
unregisterMaterialExtensions: ((this, customMaterialExtensions) => void) = iMaterialCommons.unregisterMaterialExtensions

Type declaration

MaterialProperties: {
    alphaMap: null;
    alphaTest: number;
    alphaToCoverage: boolean;
    aoMap: null;
    aoMapIntensity: number;
    attenuationColor: Color;
    attenuationDistance: number;
    blendDst: 205;
    blendDstAlpha: null;
    blendEquation: 100;
    blendEquationAlpha: null;
    blendSrc: 204;
    blendSrcAlpha: null;
    blending: 1;
    bumpMap: null;
    bumpScale: number;
    clearcoat: number;
    clearcoatMap: null;
    clearcoatNormalMap: null;
    clearcoatNormalScale: Vector2;
    clearcoatRoughness: number;
    clearcoatRoughnessMap: null;
    clipIntersection: boolean;
    clipShadows: boolean;
    clippingPlanes: null;
    color: Color;
    colorWrite: boolean;
    depthFunc: 3;
    depthTest: boolean;
    depthWrite: boolean;
    displacementBias: number;
    displacementMap: null;
    displacementScale: number;
    dithering: boolean;
    emissive: string;
    emissiveIntensity: number;
    emissiveMap: null;
    envMap: null;
    envMapIntensity: number;
    flatShading: boolean;
    fog: boolean;
    forceSinglePass: boolean;
    iridescence: number;
    iridescenceIOR: number;
    iridescenceMap: null;
    iridescenceThicknessMap: null;
    iridescenceThicknessRange: number[];
    lightMap: null;
    lightMapIntensity: number;
    map: null;
    metalness: number;
    metalnessMap: null;
    name: string;
    normalMap: null;
    normalMapType: 0;
    normalScale: Vector2;
    opacity: number;
    polygonOffset: boolean;
    polygonOffsetFactor: number;
    polygonOffsetUnits: number;
    precision: null;
    premultipliedAlpha: boolean;
    reflectivity: number;
    roughness: number;
    roughnessMap: null;
    shadowSide: null;
    sheen: number;
    sheenColor: Color;
    sheenColorMap: null;
    sheenRoughness: number;
    sheenRoughnessMap: null;
    side: 0;
    specularColor: Color;
    specularColorMap: null;
    specularIntensity: number;
    specularIntensityMap: null;
    stencilFail: 7680;
    stencilFunc: 519;
    stencilFuncMask: number;
    stencilRef: number;
    stencilWrite: boolean;
    stencilWriteMask: number;
    stencilZFail: 7680;
    stencilZPass: 7680;
    thickness: number;
    thicknessMap: null;
    toneMapped: boolean;
    transmission: number;
    transmissionMap: null;
    transparent: boolean;
    userData: {};
    vertexColors: boolean;
    visible: boolean;
    wireframe: boolean;
    wireframeLinecap: string;
    wireframeLinejoin: string;
    wireframeLinewidth: number;
} = ...

Type declaration

  • alphaMap: null
  • alphaTest: number
  • alphaToCoverage: boolean
  • aoMap: null
  • aoMapIntensity: number
  • attenuationColor: Color
  • attenuationDistance: number
  • blendDst: 205
  • blendDstAlpha: null
  • blendEquation: 100
  • blendEquationAlpha: null
  • blendSrc: 204
  • blendSrcAlpha: null
  • blending: 1
  • bumpMap: null
  • bumpScale: number
  • clearcoat: number
  • clearcoatMap: null
  • clearcoatNormalMap: null
  • clearcoatNormalScale: Vector2
  • clearcoatRoughness: number
  • clearcoatRoughnessMap: null
  • clipIntersection: boolean
  • clipShadows: boolean
  • clippingPlanes: null
  • color: Color
  • colorWrite: boolean
  • depthFunc: 3
  • depthTest: boolean
  • depthWrite: boolean
  • displacementBias: number
  • displacementMap: null
  • displacementScale: number
  • dithering: boolean
  • emissive: string
  • emissiveIntensity: number
  • emissiveMap: null
  • envMap: null
  • envMapIntensity: number
  • flatShading: boolean
  • fog: boolean
  • forceSinglePass: boolean
  • iridescence: number
  • iridescenceIOR: number
  • iridescenceMap: null
  • iridescenceThicknessMap: null
  • iridescenceThicknessRange: number[]
  • lightMap: null
  • lightMapIntensity: number
  • map: null
  • metalness: number
  • metalnessMap: null
  • name: string
  • normalMap: null
  • normalMapType: 0
  • normalScale: Vector2
  • opacity: number
  • polygonOffset: boolean
  • polygonOffsetFactor: number
  • polygonOffsetUnits: number
  • precision: null
  • premultipliedAlpha: boolean
  • reflectivity: number
  • roughness: number
  • roughnessMap: null
  • shadowSide: null
  • sheen: number
  • sheenColor: Color
  • sheenColorMap: null
  • sheenRoughness: number
  • sheenRoughnessMap: null
  • side: 0
  • specularColor: Color
  • specularColorMap: null
  • specularIntensity: number
  • specularIntensityMap: null
  • stencilFail: 7680
  • stencilFunc: 519
  • stencilFuncMask: number
  • stencilRef: number
  • stencilWrite: boolean
  • stencilWriteMask: number
  • stencilZFail: 7680
  • stencilZPass: 7680
  • thickness: number
  • thicknessMap: null
  • toneMapped: boolean
  • transmission: number
  • transmissionMap: null
  • transparent: boolean
  • userData: {}
    • vertexColors: boolean
    • visible: boolean
    • wireframe: boolean
    • wireframeLinecap: string
    • wireframeLinejoin: string
    • wireframeLinewidth: number
    MaterialTemplate: IMaterialTemplate<PhysicalMaterial, Partial<{
        alphaMap: null;
        alphaTest: number;
        alphaToCoverage: boolean;
        aoMap: null;
        aoMapIntensity: number;
        attenuationColor: Color;
        attenuationDistance: number;
        blendDst: 205;
        blendDstAlpha: null;
        blendEquation: 100;
        blendEquationAlpha: null;
        blendSrc: 204;
        blendSrcAlpha: null;
        blending: 1;
        bumpMap: null;
        bumpScale: number;
        clearcoat: number;
        clearcoatMap: null;
        clearcoatNormalMap: null;
        clearcoatNormalScale: Vector2;
        clearcoatRoughness: number;
        clearcoatRoughnessMap: null;
        clipIntersection: boolean;
        clipShadows: boolean;
        clippingPlanes: null;
        color: Color;
        colorWrite: boolean;
        depthFunc: 3;
        depthTest: boolean;
        depthWrite: boolean;
        displacementBias: number;
        displacementMap: null;
        displacementScale: number;
        dithering: boolean;
        emissive: string;
        emissiveIntensity: number;
        emissiveMap: null;
        envMap: null;
        envMapIntensity: number;
        flatShading: boolean;
        fog: boolean;
        forceSinglePass: boolean;
        iridescence: number;
        iridescenceIOR: number;
        iridescenceMap: null;
        iridescenceThicknessMap: null;
        iridescenceThicknessRange: number[];
        lightMap: null;
        lightMapIntensity: number;
        map: null;
        metalness: number;
        metalnessMap: null;
        name: string;
        normalMap: null;
        normalMapType: 0;
        normalScale: Vector2;
        opacity: number;
        polygonOffset: boolean;
        polygonOffsetFactor: number;
        polygonOffsetUnits: number;
        precision: null;
        premultipliedAlpha: boolean;
        reflectivity: number;
        roughness: number;
        roughnessMap: null;
        shadowSide: null;
        sheen: number;
        sheenColor: Color;
        sheenColorMap: null;
        sheenRoughness: number;
        sheenRoughnessMap: null;
        side: 0;
        specularColor: Color;
        specularColorMap: null;
        specularIntensity: number;
        specularIntensityMap: null;
        stencilFail: 7680;
        stencilFunc: 519;
        stencilFuncMask: number;
        stencilRef: number;
        stencilWrite: boolean;
        stencilWriteMask: number;
        stencilZFail: 7680;
        stencilZPass: 7680;
        thickness: number;
        thicknessMap: null;
        toneMapped: boolean;
        transmission: number;
        transmissionMap: null;
        transparent: boolean;
        userData: {};
        vertexColors: boolean;
        visible: boolean;
        wireframe: boolean;
        wireframeLinecap: string;
        wireframeLinejoin: string;
        wireframeLinewidth: number;
    }>> = ...
    TYPE: "PhysicalMaterial" = 'PhysicalMaterial'
    TypeSlug: "pmat" = 'pmat'

    Methods

    • Disposes the material from the GPU. Set force to false if not sure the material is used by any object in the scene. // todo add check for visible in scene also? or is that overkill

      Returns this

    • Deserializes the material from JSON. Note: some properties that are not serialized in Material.toJSON when they are default values (like side, alphaTest, blending, maps), they wont be reverted back if not present in JSON If _internal = true, Textures should be loaded and in meta.textures before calling this method.

      Parameters

      Returns null | PhysicalMaterial

    • Sets the values of this material based on the values of the passed material or an object with material properties The input is expected to be a valid material or a deserialized material parameters object(including the deserialized userdata)

      Parameters

      • parameters: Material<Event, string> | MeshPhysicalMaterialParameters & {
            type?: string;
        }

        material or material parameters object

      • allowInvalidType: boolean = true

        if true, the type of the oldMaterial is not checked. Objects without type are always allowed.

      • clearCurrentUserData: undefined | boolean = undefined

        if undefined, then depends on material.isMaterial. if true, the current userdata is cleared before setting the new values, because it can have data which wont be overwritten if not present in the new material.

      Returns this

    • Serializes this material to JSON.

      Parameters

      • Optional meta: SerializationMetaType

        metadata for serialization

      • _internal: boolean = false

        Calls only super.toJSON, does internal three.js serialization and

      Returns any

      Serialize

      tags. Set it to true only if you know what you are doing. This is used in Serialization->serializer->material

    Generated using TypeDoc