Class SpriteMaterial

Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(parameters?: SpriteMaterialParameters): SpriteMaterial

Parameters

Returns

SpriteMaterial

Properties

public alignment: Vector2

public alphaTest: number

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

public blendDst: BlendingSrcFactor

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

public blendEquation: BlendingEquation

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

public blendSrc: BlendingDstFactor

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

public blending: Blending

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

public color: Color

public depthTest: boolean

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

public 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.

public fog: boolean

public id: number

Unique number of this material instance.

public map: Texture

public name: string

Material name. Default is an empty string.

public 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.

public opacity: number

Opacity. Default is 1.

public overdraw: boolean

Enables/disables overdraw. If enabled, polygons are drawn slightly bigger in order to fix antialiasing gaps when using the CanvasRenderer. Default is false.

public polygonOffset: boolean

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

public polygonOffsetFactor: number

Sets the polygon offset factor. Default is 0.

public polygonOffsetUnits: number

Sets the polygon offset units. Default is 0.

public scaleByViewport: boolean

public 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.

public sizeAttenuation: boolean

public transparent: boolean

Defines whether this material is transparent. This has an effect on rendering, as transparent objects need an special treatment, and are rendered after the opaque (i.e. non transparent) objects. For a working example of this behaviour, check the {@link WebGLRenderer} code. Default is false.

public useScreenCoordinates: boolean

public uvOffset: Vector2

public uvScale: Vector2

public visible: boolean

Defines whether this material is visible. Default is true.

Methods

public clone(): SpriteMaterial

Returns

SpriteMaterial

public dispose()

public setValues(values: Object)

Parameters

  • values: Object