TriLib
Search Results for

    Show / Hide Table of Contents

    Class CustomizableMaterialMapper

    A customizable material mapper for converting source materials into Unity materials during runtime model importing.

    Inheritance
    object
    Object
    ScriptableObject
    MaterialMapper
    CustomizableMaterialMapper
    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.RegisteredMapperNamespaces
    MaterialMapper.RegisteredMappers
    MaterialMapper.LoadingMaterial
    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.Mappers
    Assembly: Assembly-CSharp.dll
    Syntax
    [Serializable]
    [CreateAssetMenu(menuName = "TriLib/Mappers/Material/Customizable Material Mapper", fileName = "CustomizableMaterialMapper")]
    public class CustomizableMaterialMapper : MaterialMapper

    Fields

    GenericPropertiesCount

    The number of generic material properties supported by this mapper.

    Declaration
    public const int GenericPropertiesCount = 20
    Field Value
    Type Description
    int

    GenericPropertyIndices

    Array mapping generic material properties to their corresponding indices.

    Declaration
    public static int[] GenericPropertyIndices
    Field Value
    Type Description
    int[]

    Properties

    ConvertMaterialTextures

    Gets whether material textures should be converted.

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

    CutoutMaterialPreset

    Gets the cutout material preset.

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

    CutoutMaterialPresetNoMetallicTexture

    Gets the cutout material preset without metallic textures.

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

    ExtractMetallicAndSmoothness

    Gets whether metallic and smoothness values should be extracted.

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

    MaterialPreset

    Gets the default material preset.

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

    MaterialPresetNoMetallicTexture

    Gets the material preset without metallic textures.

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

    TransparentComposeMaterialPreset

    Gets the transparent compose material preset.

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

    TransparentComposeMaterialPresetNoMetallicTexture

    Gets the transparent compose material preset without metallic textures.

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

    TransparentMaterialPreset

    Gets the transparent material preset.

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

    TransparentMaterialPresetNoMetallicTexture

    Gets the transparent material preset without metallic textures.

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

    UseShaderVariantCollection

    Gets whether to use a shader variant collection.

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

    UsesCoroutines

    Gets whether this mapper uses coroutines for asynchronous processing.

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

    Methods

    ApplyDiffuseMapTexture(TextureLoadingContext)

    Applies a diffuse map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyDisplacementTexture(TextureLoadingContext)

    Applies a displacement texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyEmissionMapTexture(TextureLoadingContext)

    Applies an emission map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyGlossinessMapTexture(TextureLoadingContext)

    Applies a glossiness or roughness map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyKeywords(MaterialMapperContext, GenericMaterialProperty)

    Applies shader keywords for a given material property.

    Declaration
    protected virtual void ApplyKeywords(MaterialMapperContext materialMapperContext, GenericMaterialProperty genericMaterialProperty)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    GenericMaterialProperty genericMaterialProperty

    The generic material property.

    ApplyMetallicGlossMapTexture(TextureLoadingContext)

    Applies a metallic gloss map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyNormalMapTexture(TextureLoadingContext)

    Applies a normal map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyOcclusionMapTexture(TextureLoadingContext)

    Applies an occlusion map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplySpecularMapTexture(TextureLoadingContext)

    Applies a specular map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    ApplyTexture(TextureLoadingContext, GenericMaterialProperty)

    Applies a texture to the material for a specific generic property.

    Declaration
    protected virtual void ApplyTexture(TextureLoadingContext textureLoadingContext, GenericMaterialProperty genericMaterialProperty)
    Parameters
    Type Name Description
    TextureLoadingContext textureLoadingContext

    The texture loading context.

    GenericMaterialProperty genericMaterialProperty

    The generic material property.

    ApplyTransparencyMapTexture(TextureLoadingContext)

    Applies a transparency map texture to the material.

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

    The texture loading context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckDiffuseColor(MaterialMapperContext)

    Checks and applies the diffuse color to the material.

    Declaration
    protected virtual IEnumerable CheckDiffuseColor(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckDiffuseMapTexture(MaterialMapperContext)

    Checks and loads the diffuse map texture.

    Declaration
    protected virtual IEnumerable CheckDiffuseMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckDisplacementTexture(MaterialMapperContext)

    Checks and loads the displacement texture.

    Declaration
    protected virtual IEnumerable CheckDisplacementTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckEmissionColor(MaterialMapperContext)

    Checks and applies the emission color to the material.

    Declaration
    protected virtual IEnumerable CheckEmissionColor(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckEmissionMapTexture(MaterialMapperContext)

    Checks and loads the emission map texture.

    Declaration
    protected virtual IEnumerable CheckEmissionMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckGlossinessMapTexture(MaterialMapperContext)

    Checks and loads the glossiness or roughness map texture.

    Declaration
    protected virtual IEnumerable CheckGlossinessMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckGlossinessValue(MaterialMapperContext)

    Checks and applies the glossiness or roughness value to the material.

    Declaration
    protected virtual IEnumerable CheckGlossinessValue(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckMetallicGlossMapTexture(MaterialMapperContext)

    Checks and loads the metallic gloss map texture.

    Declaration
    protected virtual IEnumerable CheckMetallicGlossMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckMetallicValue(MaterialMapperContext)

    Checks and applies the metallic value to the material.

    Declaration
    protected virtual IEnumerable CheckMetallicValue(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckNormalMapTexture(MaterialMapperContext)

    Checks and loads the normal map texture.

    Declaration
    protected virtual IEnumerable CheckNormalMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckOcclusionMapTexture(MaterialMapperContext)

    Checks and loads the occlusion map texture.

    Declaration
    protected virtual IEnumerable CheckOcclusionMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckSpecularMapTexture(MaterialMapperContext)

    Checks and loads the specular map texture.

    Declaration
    protected virtual IEnumerable CheckSpecularMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    CheckTransparencyMapTexture(MaterialMapperContext)

    Checks and loads the transparency map texture.

    Declaration
    protected virtual IEnumerable CheckTransparencyMapTexture(MaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    MaterialMapperContext materialMapperContext

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    GetDiffuseColorName(MaterialMapperContext)

    Gets the shader property name for the diffuse color.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the diffuse color.

    Overrides
    MaterialMapper.GetDiffuseColorName(MaterialMapperContext)

    GetDiffuseTextureName(MaterialMapperContext)

    Gets the shader property name for the diffuse texture.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the diffuse texture.

    Overrides
    MaterialMapper.GetDiffuseTextureName(MaterialMapperContext)

    GetEmissionColorName(MaterialMapperContext)

    Gets the shader property name for the emission color.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the emission color.

    Overrides
    MaterialMapper.GetEmissionColorName(MaterialMapperContext)

    GetGlossinessOrRoughnessName(MaterialMapperContext)

    Gets the shader property name for glossiness or roughness.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for glossiness or roughness.

    Overrides
    MaterialMapper.GetGlossinessOrRoughnessName(MaterialMapperContext)

    GetGlossinessOrRoughnessTextureName(MaterialMapperContext)

    Gets the shader property name for the glossiness or roughness texture.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the glossiness or roughness texture.

    Overrides
    MaterialMapper.GetGlossinessOrRoughnessTextureName(MaterialMapperContext)

    GetMappedProperty(GenericMaterialProperty)

    Gets the mapped shader property name for a generic material property.

    Declaration
    protected virtual string GetMappedProperty(GenericMaterialProperty genericMaterialProperty)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The generic material property.

    Returns
    Type Description
    string

    The mapped shader property name.

    GetMaterialPreset(Material)

    Gets the material preset, falling back to the default preset if none is specified.

    Declaration
    protected virtual Material GetMaterialPreset(Material materialPreset)
    Parameters
    Type Name Description
    Material materialPreset

    The material preset to use.

    Returns
    Type Description
    Material

    The selected material preset.

    GetMetallicName(MaterialMapperContext)

    Gets the shader property name for the metallic value.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the metallic value.

    Overrides
    MaterialMapper.GetMetallicName(MaterialMapperContext)

    GetMetallicTextureName(MaterialMapperContext)

    Gets the shader property name for the metallic texture.

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

    The material mapping context.

    Returns
    Type Description
    string

    The shader property name for the metallic texture.

    Overrides
    MaterialMapper.GetMetallicTextureName(MaterialMapperContext)

    IsCompatible(MaterialMapperContext)

    Determines if this mapper is compatible with the provided material context.

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

    The material mapping context.

    Returns
    Type Description
    bool

    True if compatible, otherwise false.

    Overrides
    MaterialMapper.IsCompatible(MaterialMapperContext)

    MapCoroutine(MaterialMapperContext)

    Maps material properties using coroutines for asynchronous processing.

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

    The material mapping context.

    Returns
    Type Description
    IEnumerable

    An enumerable of coroutine steps.

    Overrides
    MaterialMapper.MapCoroutine(MaterialMapperContext)

    Extension Methods

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