docs.unity3d.com
    Show / Hide Table of Contents

    Class Material

    The material appearance of a primitive.

    Inheritance
    Object
    NamedObject
    Material
    Inherited Members
    NamedObject.name
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GLTFast.Schema
    Syntax
    [Serializable]
    public class Material : NamedObject

    Fields

    alphaCutoff

    Specifies the cutoff threshold when in MASK mode. If the alpha value is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. This value is ignored for other modes.

    Declaration
    public float alphaCutoff
    Field Value
    Type Description
    Single

    alphaMode

    The material's alpha rendering mode enumeration specifying the interpretation of the alpha value of the main factor and texture. In OPAQUE mode, the alpha value is ignored and the rendered output is fully opaque. In MASK mode, the rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value. In BLEND mode, the alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).

    Declaration
    [SerializeField]
    public string alphaMode
    Field Value
    Type Description
    String

    doubleSided

    Specifies whether the material is double sided. When this value is false, back-face culling is enabled. When this value is true, back-face culling is disabled and double sided lighting is enabled. The back-face must have its normals reversed before the lighting equation is evaluated.

    Declaration
    public bool doubleSided
    Field Value
    Type Description
    Boolean

    emissiveTexture

    The emissive map controls the color and intensity of the light being emitted by the material. This texture contains RGB components in sRGB color space. If a fourth component (A) is present, it is ignored.

    Declaration
    public TextureInfo emissiveTexture
    Field Value
    Type Description
    TextureInfo

    extensions

    Material extensions.

    Declaration
    public MaterialExtension extensions
    Field Value
    Type Description
    MaterialExtension

    normalTexture

    A tangent space normal map. Each texel represents the XYZ components of a normal vector in tangent space.

    Declaration
    public NormalTextureInfo normalTexture
    Field Value
    Type Description
    NormalTextureInfo

    occlusionTexture

    The occlusion map is a greyscale texture, with white indicating areas that should receive full indirect lighting and black indicating no indirect lighting.

    Declaration
    public OcclusionTextureInfo occlusionTexture
    Field Value
    Type Description
    OcclusionTextureInfo

    pbrMetallicRoughness

    A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.

    Declaration
    public PbrMetallicRoughness pbrMetallicRoughness
    Field Value
    Type Description
    PbrMetallicRoughness

    Properties

    Emissive

    Emissive color of the material.

    Declaration
    public Color Emissive { get; set; }
    Property Value
    Type Description
    Color

    RequiresNormals

    True if the material requires the mesh to have normals.

    Declaration
    public bool RequiresNormals { get; }
    Property Value
    Type Description
    Boolean

    RequiresTangents

    True if the material requires the mesh to have tangents.

    Declaration
    public bool RequiresTangents { get; }
    Property Value
    Type Description
    Boolean

    Methods

    GetAlphaMode()

    Material.AlphaMode typed and cached getter for alphaMode string.

    Declaration
    public Material.AlphaMode GetAlphaMode()
    Returns
    Type Description
    Material.AlphaMode

    Alpha mode if it was retrieved correctly. Opaque otherwise

    SetAlphaMode(Material.AlphaMode)

    Material.AlphaMode typed setter for alphaMode string.

    Declaration
    public void SetAlphaMode(Material.AlphaMode mode)
    Parameters
    Type Name Description
    Material.AlphaMode mode

    Alpha mode

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023