TriLib
Search Results for

    Show / Hide Table of Contents

    Class MaterialRendererContext

    Holds contextual information for assigning a TriLib-supplied IMaterial to a specific Unity Renderer at a particular sub-mesh index. This class also references the corresponding MaterialMapperContext and the broader AssetLoaderContext to unify data during material application.

    Inheritance
    object
    MaterialRendererContext
    Implements
    IAssetLoaderContext
    IAwaitable
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: TriLibCore
    Assembly: TriLibCore.dll
    Syntax
    public class MaterialRendererContext : IAssetLoaderContext, IAwaitable

    Constructors

    MaterialRendererContext()

    Declaration
    public MaterialRendererContext()

    Fields

    GeometryIndex

    The sub-mesh index within the Renderer that should be assigned the final Unity Material. This corresponds to a geometry slot in the mesh.

    Declaration
    public int GeometryIndex
    Field Value
    Type Description
    int

    Material

    The original TriLib IMaterial object that contains surface properties (e.g., textures, colors) to be mapped or converted into a Unity Material.

    Declaration
    public IMaterial Material
    Field Value
    Type Description
    IMaterial

    Renderer

    The Unity Renderer (e.g., UnityEngine.MeshRenderer, UnityEngine.SkinnedMeshRenderer) that will receive the final material assignment.

    Declaration
    public Renderer Renderer
    Field Value
    Type Description
    Renderer

    Properties

    Completed

    Indicates whether the material application has completed. Can be false if asynchronous texture loading or other tasks are still in progress.

    Declaration
    public bool Completed { get; set; }
    Property Value
    Type Description
    bool

    Context

    Reference to the AssetLoaderContext which holds the overarching model loading details. This includes references to loaded UnityEngine.GameObjects, import settings, tasks, and callbacks.

    Declaration
    public AssetLoaderContext Context { get; set; }
    Property Value
    Type Description
    AssetLoaderContext

    MaterialMapperContext

    Reference to the MaterialMapperContext that is managing the conversion of this TriLib IMaterial into a Unity Material. This object stores intermediate data (e.g., VirtualMaterial properties).

    Declaration
    public MaterialMapperContext MaterialMapperContext { get; set; }
    Property Value
    Type Description
    MaterialMapperContext

    Mesh

    The specific Mesh (or UnityEngine.MeshFilter.mesh / UnityEngine.SkinnedMeshRenderer.sharedMesh) to which this material is being applied. This reference can be null if not required by the mapper logic (e.g., for blend shape or multi-pass scenarios).

    Declaration
    public Mesh Mesh { get; set; }
    Property Value
    Type Description
    Mesh

    Implements

    IAssetLoaderContext
    IAwaitable

    Extension Methods

    IObjectExtensions.TryToDispose<T>(object)
    In this article
    Back to top Generated by DocFX