TriLib
Search Results for

    Show / Hide Table of Contents

    Class UniversalRPMaterialMapper

    Converts TriLib virtual materials into Unity Universal Render Pipeline (URP) materials by processing various texture maps and material properties through an asynchronous coroutine pipeline.

    Inheritance
    object
    Object
    ScriptableObject
    MaterialMapper
    UniversalRPMaterialMapper
    Inherited Members
    MaterialMapper.CheckingOrder
    MaterialMapper.DisableAlpha
    MaterialMapper.ApplyMaterialToRenderer(MaterialRendererContext)
    MaterialMapper.Cleanup(MaterialRendererContext)
    MaterialMapper.Map(MaterialMapperContext)
    MaterialMapper.CheckTextureOffsetAndScaling(TextureLoadingContext)
    MaterialMapper.CheckTextureOffsetAndScaling(MaterialMapperContext, ITexture, bool)
    MaterialMapper.CheckTextureOffsetAndScalingCoroutine(TextureLoadingContext)
    MaterialMapper.BuildMaterial(MaterialMapperContext)
    MaterialMapper.LoadTextureWithCallbacks(MaterialMapperContext, TextureType, ITexture, params Action<TextureLoadingContext>[])
    MaterialMapper.LoadTextureWithCoroutineCallbacks(MaterialMapperContext, TextureType, ITexture, params Func<TextureLoadingContext, IEnumerable>[])
    MaterialMapper.UseShaderVariantCollection
    MaterialMapper.RegisteredMapperNamespaces
    MaterialMapper.RegisteredMappers
    MaterialMapper.CutoutMaterialPresetNoMetallicTexture
    MaterialMapper.MaterialPresetNoMetallicTexture
    MaterialMapper.TransparentComposeMaterialPresetNoMetallicTexture
    MaterialMapper.TransparentMaterialPresetNoMetallicTexture
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TriLibCore.URP.Mappers
    Assembly: Assembly-CSharp.dll
    Syntax
    [Serializable]
    [CreateAssetMenu(menuName = "TriLib/Mappers/Material/Universal RP Material Mapper", fileName = "UniversalRPMaterialMapper")]
    public class UniversalRPMaterialMapper : MaterialMapper

    Properties

    CutoutMaterialPreset

    A cutout material preset for materials that use alpha testing (fully transparent vs. fully opaque).

    Declaration
    public override Material CutoutMaterialPreset { get; }
    Property Value
    Type Description
    Material
    Overrides
    MaterialMapper.CutoutMaterialPreset

    ExtractMetallicAndSmoothness

    Indicates whether TriLib automatically extracts metallic and smoothness data from the source material textures. Inheritors can override this to disable the extraction step.

    Declaration
    public override bool ExtractMetallicAndSmoothness { get; }
    Property Value
    Type Description
    bool
    Overrides
    MaterialMapper.ExtractMetallicAndSmoothness

    LoadingMaterial

    An optional placeholder material used while a model’s final materials and textures are still loading.

    Declaration
    public override Material LoadingMaterial { get; }
    Property Value
    Type Description
    Material
    Overrides
    MaterialMapper.LoadingMaterial

    MaterialPreset

    The default (opaque) material preset.

    Declaration
    public override Material MaterialPreset { get; }
    Property Value
    Type Description
    Material
    Overrides
    MaterialMapper.MaterialPreset

    TransparentComposeMaterialPreset

    A “compose” material preset used in layered alpha workflows when AlphaMaterialMode is set to CutoutAndTransparent. This is applied as a secondary pass for partially transparent regions.

    Declaration
    public override Material TransparentComposeMaterialPreset { get; }
    Property Value
    Type Description
    Material
    Overrides
    MaterialMapper.TransparentComposeMaterialPreset

    TransparentMaterialPreset

    A fully transparent (alpha) material preset.

    Declaration
    public override Material TransparentMaterialPreset { get; }
    Property Value
    Type Description
    Material
    Overrides
    MaterialMapper.TransparentMaterialPreset

    UsesCoroutines

    Indicates whether this mapper’s Map(MaterialMapperContext) process requires an asynchronous coroutine approach (true), or can run synchronously (false).

    Declaration
    public override bool UsesCoroutines { get; }
    Property Value
    Type Description
    bool
    Overrides
    MaterialMapper.UsesCoroutines
    Remarks

    Returning true means MapCoroutine(MaterialMapperContext) will be called instead of Map(MaterialMapperContext).

    Methods

    ApplyGlossinessMapTexture(TextureLoadingContext)

    Declaration
    protected virtual IEnumerable ApplyGlossinessMapTexture(TextureLoadingContext textureLoadingContext)
    Parameters
    Type Name Description
    TextureLoadingContext textureLoadingContext
    Returns
    Type Description
    IEnumerable

    GetDiffuseColorName(MaterialMapperContext)

    Retrieves the property name for the diffuse (albedo) color within this mapper’s target shaders.

    Declaration
    public override string GetDiffuseColorName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetDiffuseColorName(MaterialMapperContext)

    GetDiffuseTextureName(MaterialMapperContext)

    Retrieves the property name for the diffuse (albedo) texture within this mapper’s target shaders.

    Declaration
    public override string GetDiffuseTextureName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetDiffuseTextureName(MaterialMapperContext)

    GetEmissionColorName(MaterialMapperContext)

    Retrieves the property name for the emissive color within this mapper’s target shaders.

    Declaration
    public override string GetEmissionColorName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetEmissionColorName(MaterialMapperContext)

    GetGlossinessOrRoughnessName(MaterialMapperContext)

    Retrieves the property name for glossiness or roughness, depending on the shader’s workflow.

    Declaration
    public override string GetGlossinessOrRoughnessName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetGlossinessOrRoughnessName(MaterialMapperContext)

    GetGlossinessOrRoughnessTextureName(MaterialMapperContext)

    Retrieves the property name for the glossiness or roughness texture, if applicable.

    Declaration
    public override string GetGlossinessOrRoughnessTextureName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetGlossinessOrRoughnessTextureName(MaterialMapperContext)

    GetMetallicName(MaterialMapperContext)

    Retrieves the property name for metallic values in PBR workflows.

    Declaration
    public override string GetMetallicName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetMetallicName(MaterialMapperContext)

    GetMetallicTextureName(MaterialMapperContext)

    Retrieves the property name for the metallic texture, if used in the target shader.

    Declaration
    public override string GetMetallicTextureName(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Context containing the TriLib virtual material and Unity material references.

    Returns
    Type Description
    string
    Overrides
    MaterialMapper.GetMetallicTextureName(MaterialMapperContext)

    IsCompatible(MaterialMapperContext)

    Determines whether this mapper can handle the specified material (e.g., by checking shader keywords, pipeline features, or other criteria). Mappers with false returns are skipped in favor of others with higher compatibility.

    Declaration
    public override bool IsCompatible(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The context providing references to both the TriLib VirtualMaterial data and the underlying Unity UnityEngine.Material.

    Returns
    Type Description
    bool

    true if compatible; otherwise false.

    Overrides
    MaterialMapper.IsCompatible(MaterialMapperContext)

    MapCoroutine(MaterialMapperContext)

    Begins the material mapping process asynchronously, yielding control back to the caller to allow frame updates or concurrent loading. Called if UsesCoroutines returns true.

    Declaration
    public override IEnumerable MapCoroutine(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    Holds references to the TriLib virtual material, the target Unity material, and the overall AssetLoaderContext.

    Returns
    Type Description
    IEnumerable

    An IEnumerable sequence that yields at intermediate steps for cooperative asynchronous processing.

    Overrides
    MaterialMapper.MapCoroutine(MaterialMapperContext)

    Extension Methods

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