Autodesk.Viewing.Scene
UnlitMaterial
A simple, unlit material for 3D surfaces.
new UnlitMaterial(params)
Parameters
Expand all
| params object | |
| color | Diffuse surface color. Default: white. |
| opacity number | Surface opacity in [0, 1]. Default: 1. |
| map | Color (albedo) texture. |
| alphaMap | Alpha mask texture. |
| vertexColors boolean | Multiply surface color by per-vertex colors. Default: false. |
| side Side | Faces to render. Default: Side.Front. |
| depthWrite boolean | Write to the depth buffer. Default: true. |
| depthTest boolean | Depth-test against the depth buffer. Default: true. |
| transparent boolean | Render in the transparent pass with alpha blending. Default: false. |
Methods
clone(material)
Parameters
| material | Target to copy into. Default: a new UnlitMaterial. |
Returns
| type | description |
|---|---|
| UnlitMaterial |
getColor()
Returns
| type | description |
|---|---|
| Color | A defensive clone of the diffuse color. |
setColor(c)
Parameters
| c* | Diffuse color. Copied into the existing Color. |
* Required
getOpacity()
Returns
| type | description |
|---|---|
| number | Surface opacity in [0, 1]. |
setOpacity(o)
Parameters
| o* number | Surface opacity in [0, 1]. Requires setTransparent(true) for < 1. |
* Required
getMap()
Returns the color (albedo) texture.
Returns
| type | description |
|---|---|
| Texture | Color (albedo) texture, or null. |
setMap(t)
Sets the color (albedo) texture.
Parameters
| t* | Color (albedo) texture, or null. |
* Required
getAlphaMap()
Gets the alpha mask texture.
Returns
| type | description |
|---|---|
| Texture | Alpha mask texture, or null. |
setAlphaMap(t)
Sets the alpha mask texture.
Parameters
| t* | Alpha mask texture, or null. |
* Required
getVertexColors()
Returns
| type | description |
|---|---|
| boolean | Whether to multiply the surface color by per-vertex colors. |
setVertexColors(v)
Parameters
| v* boolean | Whether to multiply the surface color by per-vertex colors. |
* Required
getSide()
Gets which face(s) of a polygon are rendered.
Returns
| type | description |
|---|---|
| Side | Faces to render. |
setSide(s)
Sets which face(s) of a polygon are rendered.
Parameters
| s* Side | Faces to render. |
* Required
getDepthWrite()
Returns
| type | description |
|---|---|
| boolean | Whether to write to the depth buffer. |
setDepthWrite(v)
Parameters
| v* boolean | Whether to write to the depth buffer. |
* Required
getDepthTest()
Returns
| type | description |
|---|---|
| boolean | Whether to depth-test against the depth buffer. |
setDepthTest(v)
Parameters
| v* boolean | Whether to depth-test against the depth buffer. |
* Required
getTransparent()
Returns
| type | description |
|---|---|
| boolean | Whether the material renders in the transparent pass. |
setTransparent(v)
Parameters
| v* boolean | Whether the material renders in the transparent pass with alpha blending. |
* Required