docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MaterialPropertyAttribute

    Marks an IComponentData as an input to a material property on a particular shader.

    Inheritance
    object
    Attribute
    MaterialPropertyAttribute
    Namespace: Unity.Rendering
    Assembly: Unity.Entities.Graphics.dll
    Syntax
    [AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)]
    public class MaterialPropertyAttribute : Attribute

    Constructors

    MaterialPropertyAttribute(string, short)

    Constructs a material property attribute.

    Declaration
    public MaterialPropertyAttribute(string materialPropertyName, short overrideSizeGPU = -1)
    Parameters
    Type Name Description
    string materialPropertyName

    The name of the material property.

    short overrideSizeGPU

    An optional size of the property on the GPU. This is in bytes.

    Properties

    Name

    The name of the material property.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    OverrideSizeGPU

    The size of the property in bytes on the GPU.

    Declaration
    public short OverrideSizeGPU { get; }
    Property Value
    Type Description
    short
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)