Request

Response

    Autodesk.Viewing.Scene
    Version 8 preview
    This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.

    UnlitMaterial

    A simple, unlit material for 3D surfaces.

    new UnlitMaterial(params)

    Parameters

    Expand all
    params
    object
    colorDiffuse surface color. Default: white.
    opacity
    number
    Surface opacity in [0, 1]. Default: 1.
    mapColor (albedo) texture.
    alphaMapAlpha 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

    materialTarget to copy into. Default: a new UnlitMaterial.

    Returns

    typedescription
    UnlitMaterial

    getColor()

    Returns

    typedescription
    Color A defensive clone of the diffuse color.

    setColor(c)

    Parameters

    c*Diffuse color. Copied into the existing Color.
    * Required

    getOpacity()

    Returns

    typedescription
    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

    typedescription
    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

    typedescription
    Texture Alpha mask texture, or null.

    setAlphaMap(t)

    Sets the alpha mask texture.

    Parameters

    t*Alpha mask texture, or null.
    * Required

    getVertexColors()

    Returns

    typedescription
    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

    typedescription
    Side Faces to render.

    setSide(s)

    Sets which face(s) of a polygon are rendered.

    Parameters

    s*
    Side
    Faces to render.
    * Required

    getDepthWrite()

    Returns

    typedescription
    boolean Whether to write to the depth buffer.

    setDepthWrite(v)

    Parameters

    v*
    boolean
    Whether to write to the depth buffer.
    * Required

    getDepthTest()

    Returns

    typedescription
    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

    typedescription
    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