Class ShaderMaterial2<E, ET>

Type Parameters

Hierarchy (View Summary)

Implements

Constructors

Properties

appliedMeshes: Set<any> = ...

Managed internally, do not change manually

assetType: "material" = ...
constructor: typeof ShaderMaterial2

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

extraUniformsToUpload: Record<string, IUniform> = {}
isAShaderMaterial: true
isRawShaderMaterial: boolean
materialExtensions: MaterialExtension[] = []
registerMaterialExtensions: (
    this: IMaterial,
    customMaterialExtensions: MaterialExtension[],
) => void = iMaterialCommons.registerMaterialExtensions
setDirty: (this: IMaterial, options?: IMaterialSetDirtyOptions) => void = iMaterialCommons.setDirty
type: "ShaderMaterial" | "RawShaderMaterial" = 'ShaderMaterial'
'ShaderMaterial'
unregisterMaterialExtensions: (
    this: IMaterial,
    customMaterialExtensions: MaterialExtension[],
) => void = iMaterialCommons.unregisterMaterialExtensions

An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.

{}
MaterialProperties: {
    alphaTest: number;
    alphaToCoverage: boolean;
    blendDst: 205;
    blendDstAlpha: null;
    blendEquation: 100;
    blendEquationAlpha: null;
    blending: 1;
    blendSrc: 204;
    blendSrcAlpha: null;
    clipIntersection: boolean;
    clipping: boolean;
    clippingPlanes: null;
    clipShadows: boolean;
    colorWrite: boolean;
    defaultAttributeValues: {};
    defines: {};
    depthFunc: 3;
    depthTest: boolean;
    depthWrite: boolean;
    dithering: boolean;
    extensions: {};
    fog: boolean;
    forceSinglePass: boolean;
    fragmentShader: string;
    glslVersion: null;
    isRawShaderMaterial: boolean;
    lights: boolean;
    name: string;
    opacity: number;
    polygonOffset: boolean;
    polygonOffsetFactor: number;
    polygonOffsetUnits: number;
    precision: null;
    premultipliedAlpha: boolean;
    shadowSide: null;
    side: 0;
    stencilFail: 7680;
    stencilFunc: 519;
    stencilFuncMask: number;
    stencilRef: number;
    stencilWrite: boolean;
    stencilWriteMask: number;
    stencilZFail: 7680;
    stencilZPass: 7680;
    toneMapped: boolean;
    transparent: boolean;
    uniforms: {};
    uniformsGroups: {};
    userData: {};
    vertexColors: boolean;
    vertexShader: string;
    visible: boolean;
    wireframe: boolean;
    wireframeLinewidth: number;
} = ...
TYPE: "ShaderMaterial2" = 'ShaderMaterial2'
TypeSlug: "shaderMat" = 'shaderMat'

Accessors

Methods

  • Return a new material with the same parameters as this material.

    Returns this

  • In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader as needed.

    Returns string

  • An optional callback that is executed immediately before the shader program is compiled. This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.

    Parameters

    • shader: Shader

      Source code of the shader

    • renderer: WebGLRenderer

      WebGLRenderer Context that is initializing the material

    Returns void

  • Convert the material to three.js JSON format.

    Parameters

    • Optional_: any

      Object containing metadata such as textures or images for the material.

    Returns any