Material
new Material({ layer?, opacity?, transparent?, depthTest?, depthWrite?, shading?, side? })THREE equivalent: THREE.Material
Base material. All materials share the layer, opacity, depth, shading, and side properties. Not intended to be used directly - use a subclass.
Differs from THREE.js
opacity is a 0–8 integer (nine discrete steps), not a 0–1 float. layer has no THREE equivalent.
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
id |
number |
Auto-incrementing unique identifier. |
name |
string |
Optional display name. |
layer |
number |
Draw order within a tile. Higher values draw later (on top). See Layer enum. |
opacity |
number |
Discrete translucency: 0 = fully opaque, 8 = nearly transparent. Only blends when transparent is true. |
transparent |
boolean |
Enables transparent sorting and blending. Default false. |
depthTest |
boolean |
Enables depth-buffer testing. Default true. |
depthWrite |
boolean |
Writes passing fragments to the depth buffer. Default true for opaque materials and false when constructed with transparent: true. |
shading |
number |
Shading.Flat or Shading.Gouraud. |
side |
number |
Side.Front, Side.Back, or Side.Double. |
visible |
boolean |
When false, meshes using this material are skipped. |
needsUpdate |
boolean |
Flag for external cache invalidation. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
clone(): Material |
Returns a copy of this material. |
dispose(): void |
Override in subclasses to release texture references. |