Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MapMeshStandardMaterial

Subclass of THREE.MeshStandardMaterial. Adds new properties required for fadeNear and fadeFar. In addition to the new properties (which fill respective uniforms), it is also required to update the material in their objects onBeforeRender and OnAfterRender calls, where their flag transparent is set and the internal fadeNear/fadeFar values are updated to world space distances.

see

[[Tile#addRenderHelper]]

Hierarchy

  • MeshStandardMaterial
    • MapMeshStandardMaterial

Implements

Index

Constructors

constructor

Properties

alphaMap

alphaMap: Texture | null
default

null

alphaTest

alphaTest: number

Sets the alpha value to be used when running an alpha test. Default is 0.

default

0

alphaToCoverage

alphaToCoverage: boolean

Enables alpha to coverage. Can only be used with MSAA-enabled rendering contexts.

default

false

aoMap

aoMap: Texture | null
default

null

aoMapIntensity

aoMapIntensity: number
default

1

blendDst

blendDst: BlendingDstFactor

Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}.

default

THREE.OneMinusSrcAlphaFactor

blendDstAlpha

blendDstAlpha: number | null

The tranparency of the .blendDst. Default is null.

default

null

blendEquation

blendEquation: BlendingEquation

Blending equation to use when applying blending. It's one of the constants defined in Three.js. Default is {@link AddEquation}.

default

THREE.AddEquation

blendEquationAlpha

blendEquationAlpha: number | null

The tranparency of the .blendEquation. Default is null.

default

null

blendSrc

blendSrc: BlendingSrcFactor | BlendingDstFactor

Blending source. It's one of the blending mode constants defined in Three.js. Default is {@link SrcAlphaFactor}.

default

THREE.SrcAlphaFactor

blendSrcAlpha

blendSrcAlpha: number | null

The tranparency of the .blendSrc. Default is null.

default

null

blending

blending: Blending

Which blending to use when displaying objects with this material. Default is {@link NormalBlending}.

default

THREE.NormalBlending

bumpMap

bumpMap: Texture | null
default

null

bumpScale

bumpScale: number
default

1

clipIntersection

clipIntersection: boolean

Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. Default is false.

default

false

clipShadows

clipShadows: boolean

Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.

default

false

clippingPlanes

clippingPlanes: any

User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply to the objects this material is attached to. Points in space whose signed distance to the plane is negative are clipped (not rendered). See the WebGL / clipping /intersection example. Default is null.

default

null

color

color: Color
default

new THREE.Color( 0xffffff )

colorWrite

colorWrite: boolean

Whether to render the material's color. This can be used in conjunction with a mesh's .renderOrder property to create invisible objects that occlude other objects. Default is true.

default

true

defines

defines: {}
default

{ 'STANDARD': '' }

Type declaration

  • [key: string]: any

depthFunc

depthFunc: DepthModes

Which depth function to use. Default is {@link LessEqualDepth}. See the depth mode constants for all possible values.

default

THREE.LessEqualDepth

depthTest

depthTest: boolean

Whether to have depth test enabled when rendering this material. Default is true.

default

true

depthWrite

depthWrite: boolean

Whether rendering this material has any effect on the depth buffer. Default is true. When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.

default

true

displacementBias

displacementBias: number
default

0

displacementMap

displacementMap: Texture | null
default

null

displacementScale

displacementScale: number
default

1

dithering

dithering: boolean

Whether to apply dithering to the color to remove the appearance of banding. Default is false.

default

false

emissive

emissive: Color
default

new THREE.Color( 0x000000 )

emissiveIntensity

emissiveIntensity: number
default

1

emissiveMap

emissiveMap: Texture | null
default

null

envMap

envMap: Texture | null
default

null

envMapIntensity

envMapIntensity: number
default

1

flatShading

flatShading: boolean

Define whether the material is rendered with flat shading. Default is false.

default

false

fog

fog: boolean

Whether the material is affected by fog. Default is true.

default

fog

id

id: number

Unique number of this material instance.

Readonly isMaterial

isMaterial: true

Used to check whether this or derived classes are materials. Default is true. You should not change this, as it used internally for optimisation.

isMeshStandardMaterial

isMeshStandardMaterial: boolean

lightMap

lightMap: Texture | null
default

null

lightMapIntensity

lightMapIntensity: number
default

1

map

map: Texture | null
default

null

metalness

metalness: number
default

0

metalnessMap

metalnessMap: Texture | null
default

null

morphNormals

morphNormals: boolean
default

false

morphTargets

morphTargets: boolean
default

false

name

name: string

Material name. Default is an empty string.

default

''

needsUpdate

needsUpdate: boolean

Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL. This property is automatically set to true when instancing a new material.

default

false

normalMap

normalMap: Texture | null
default

null

normalMapType

normalMapType: NormalMapTypes
default

THREE.TangentSpaceNormalMap

normalScale

normalScale: Vector2
default

new THREE.Vector2( 1, 1 )

opacity

opacity: number

Opacity. Default is 1.

default

1

polygonOffset

polygonOffset: boolean

Whether to use polygon offset. Default is false. This corresponds to the POLYGON_OFFSET_FILL WebGL feature.

default

false

polygonOffsetFactor

polygonOffsetFactor: number

Sets the polygon offset factor. Default is 0.

default

0

polygonOffsetUnits

polygonOffsetUnits: number

Sets the polygon offset units. Default is 0.

default

0

precision

precision: "highp" | "mediump" | "lowp" | null

Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp". Defaults is null.

default

null

premultipliedAlpha

premultipliedAlpha: boolean

Whether to premultiply the alpha (transparency) value. See WebGL / Materials / Transparency for an example of the difference. Default is false.

default

false

refractionRatio

refractionRatio: number
default

0.98

roughness

roughness: number
default

1

roughnessMap

roughnessMap: Texture | null
default

null

shadowSide

shadowSide: Side

Defines which of the face sides will cast shadows. Default is null*. If *null, the value is opposite that of side, above.

default

null

side

side: Side

Defines which of the face sides will be rendered - front, back or both. Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide.

default

THREE.FrontSide

stencilFail

stencilFail: StencilOp

Which stencil operation to perform when the comparison function returns false. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.

default

THREE.KeepStencilOp

stencilFunc

stencilFunc: StencilFunc

The stencil comparison function to use. Default is {@link AlwaysStencilFunc}. See stencil operation constants for all possible values.

default

THREE.AlwaysStencilFunc

stencilFuncMask

stencilFuncMask: number

The bit mask to use when comparing against the stencil buffer. Default is 0xFF.

default

0xff

stencilRef

stencilRef: number

The value to use when performing stencil comparisons or stencil operations. Default is 0.

default

0

stencilWrite

stencilWrite: boolean

Whether rendering this material has any effect on the stencil buffer. Default is false.

default

false

stencilWriteMask

stencilWriteMask: number

The bit mask to use when writing to the stencil buffer. Default is 0xFF.

default

0xff

stencilZFail

stencilZFail: StencilOp

Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.

default

THREE.KeepStencilOp

stencilZPass

stencilZPass: StencilOp

Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.

default

THREE.KeepStencilOp

toneMapped

toneMapped: boolean

Defines whether this material is tone mapped according to the renderer's toneMapping setting. Default is true.

default

true

transparent

transparent: boolean

Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. When set to true, the extent to which the material is transparent is controlled by setting it's .opacity property. Default is false.

default

false

type

type: string
default

'MeshStandardMaterial'

Optional uniformsNeedUpdate

uniformsNeedUpdate: undefined | false | true

userData

userData: any

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.

default

{}

uuid

uuid: string

UUID of this material instance. This gets automatically assigned, so this shouldn't be edited.

version

version: number

This starts at 0 and counts how many times .needsUpdate is set to true.

default

0

vertexColors

vertexColors: boolean

Defines whether vertex coloring is used. Default is false.

default

false

vertexTangents

vertexTangents: boolean
default

false

visible

visible: boolean

Defines whether this material is visible. Default is true.

default

true

wireframe

wireframe: boolean
default

false

wireframeLinecap

wireframeLinecap: string
default

'round'

wireframeLinejoin

wireframeLinejoin: string
default

'round'

wireframeLinewidth

wireframeLinewidth: number
default

1

Accessors

extrusionRatio

  • get extrusionRatio(): number
  • set extrusionRatio(value: number): void

fadeFar

  • get fadeFar(): number
  • set fadeFar(value: number): void

fadeNear

  • get fadeNear(): number
  • set fadeNear(value: number): void

removeDiffuseLight

  • get removeDiffuseLight(): boolean
  • set removeDiffuseLight(val: boolean): void
  • This is needed to simplify the lighting calculation, currently there is no support for switching this at runtime. It is required here to be a property because the parameters are applied to this material, and if this isn't here, three.js will complain that the property is missing.

    internal

    Returns boolean

  • This is needed to simplify the lighting calculation, currently there is no support for switching this at runtime. It is required here to be a property because the parameters are applied to this material, and if this isn't here, three.js will complain that the property is missing.

    internal

    Parameters

    • val: boolean

    Returns void

Methods

addEventListener

  • addEventListener(type: string, listener: (event: Event) => void): void
  • Adds a listener to an event type.

    Parameters

    • type: string

      The type of event to listen to.

    • listener: (event: Event) => void

      The function that gets called when the event is fired.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns void

Protected addExtrusionProperties

  • addExtrusionProperties(): void

Protected addFadingProperties

  • addFadingProperties(): void

Protected applyExtrusionParameters

Protected applyFadingParameters

clone

  • clone(): this

copy

  • copy(source: this): any

Protected copyExtrusionParameters

Protected copyFadingParameters

customProgramCacheKey

  • customProgramCacheKey(): string
  • 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

dispatchEvent

  • dispatchEvent(event: { type: string }): void
  • Fire an event type.

    Parameters

    • event: { type: string }
      • [attachment: string]: any
      • type: string

    Returns void

dispose

  • dispose(): void
  • This disposes the material. Textures of a material don't get disposed. These needs to be disposed by {@link Texture}.

    Returns void

hasEventListener

  • hasEventListener(type: string, listener: (event: Event) => void): boolean
  • Checks if listener is added to an event type.

    Parameters

    • type: string

      The type of event to listen to.

    • listener: (event: Event) => void

      The function that gets called when the event is fired.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns boolean

onBeforeCompile

  • onBeforeCompile(shader: Shader, renderer: WebGLRenderer): void
  • 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

removeEventListener

  • removeEventListener(type: string, listener: (event: Event) => void): void
  • Removes a listener from an event type.

    Parameters

    • type: string

      The type of the listener that gets removed.

    • listener: (event: Event) => void

      The listener function that gets removed.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns void

setValues

  • setValues(parameters: MeshStandardMaterialParameters): void
  • Parameters

    • parameters: MeshStandardMaterialParameters

    Returns void

toJSON

  • toJSON(meta?: any): any
  • Convert the material to three.js JSON format.

    Parameters

    • Optional meta: any

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

    Returns any

Generated using TypeDoc