TriLib 2.2.8
|
Represents a Mapper used to convert Model Materials into Unity Materials. More...
Public Member Functions | |
virtual bool | IsCompatible (MaterialMapperContext materialMapperContext) |
Determines whether this Mapper is compatible with the given Material Renderer Context. | |
virtual void | Map (MaterialMapperContext materialMapperContext) |
Starts the mapping process, comparing the Mapper Properties against the source Material ones. | |
void | ApplyMaterialToRenderer (MaterialRendererContext materialRendererContext) |
Applies Material to the Renderer using the context data. | |
virtual string | GetDiffuseTextureName (MaterialMapperContext materialMapperContext) |
Gets the Diffuse Texture Property name. | |
virtual string | GetDiffuseColorName (MaterialMapperContext materialMapperContext) |
Gets the Diffuse Color Property name. | |
virtual string | GetEmissionColorName (MaterialMapperContext materialMapperContext) |
Gets the Emission Color Property name. | |
virtual string | GetGlossinessOrRoughnessName (MaterialMapperContext materialMapperContext) |
Gets the Glossiness or Roughness Property name. | |
virtual string | GetMetallicName (MaterialMapperContext materialMapperContext) |
Gets the Metallic Property name. | |
virtual string | GetGlossinessOrRoughnessTextureName (MaterialMapperContext materialMapperContext) |
Gets the Glossiness or Roughness Texture Property name. | |
virtual string | GetMetallicTextureName (MaterialMapperContext materialMapperContext) |
Gets the Metallic Texture Property name. | |
Static Public Attributes | |
static Action< TextureLoadingContext > | CreateTextureCallback |
static Action< TextureLoadingContext > | LoadTextureCallback |
static Action< TextureLoadingContext > | ScanForAlphaPixelsCallback |
static Action< TextureLoadingContext > | ApplyTextureCallback |
static Action< TextureLoadingContext > | FixNPOTTextureCallback |
static Action< TextureLoadingContext > | FixNormalMapCallback |
static Action< TextureLoadingContext > | PostProcessTextureCallback |
The method to call when the Mapper has to post-process a Texture data. | |
Protected Member Functions | |
void | LoadTextureWithCallbacks (MaterialMapperContext materialMapperContext, TextureType textureType, ITexture texture, params Action< TextureLoadingContext >[] onTextureProcessed) |
Loads a Texture using callbacks to be called on the main Thread later. | |
void | BuildMaterial (MaterialMapperContext materialMapperContext) |
Creates the final Unity Material using the given context data. | |
Static Protected Member Functions | |
static void | CheckTextureOffsetAndScaling (TextureLoadingContext textureLoadingContext) |
Applies the Texture scaling and offset, when applicable. | |
static void | CheckTextureOffsetAndScaling (MaterialMapperContext materialMapperContext, ITexture texture, bool textureLoaded) |
Properties | |
static List< string > | RegisteredMappers [get] |
Default Material Mappers list. | |
static List< string > | RegisteredMapperNamespaces [get] |
Default Material Mappers namespace list. | |
virtual bool | ExtractMetallicAndSmoothness = true [get] |
Turn off this field to disable metallic and smoothness textures extraction. | |
virtual Material | MaterialPreset [get] |
Standard Material preset to instantiate. | |
virtual Material | CutoutMaterialPreset [get] |
Cutout material preset. | |
virtual Material | TransparentMaterialPreset [get] |
Transparent (alpha) material preset. | |
virtual Material | TransparentComposeMaterialPreset [get] |
Compose (secondary) material preset to use when AssetLoaderOptions.AlphaMaterialMode is set to CutoutAndTransparent. | |
virtual Material | MaterialPresetNoMetallicTexture [get] |
virtual Material | CutoutMaterialPresetNoMetallicTexture [get] |
virtual Material | TransparentMaterialPresetNoMetallicTexture [get] |
virtual Material | TransparentComposeMaterialPresetNoMetallicTexture [get] |
virtual Material | SpecularMaterialPreset [get] |
virtual Material | SpecularCutoutMaterialPreset [get] |
virtual Material | SpecularTransparentMaterialPreset [get] |
virtual Material | SpecularTransparentComposeMaterialPreset [get] |
virtual Material | AutodeskMaterialPreset [get] |
virtual Material | AutodeskCutoutMaterialPreset [get] |
virtual Material | AutodeskTransparentMaterialPreset [get] |
virtual Material | AutodeskTransparentComposeMaterialPreset [get] |
virtual Material | LoadingMaterial [get] |
Gets the loading Material preset for this Mapper. | |
Represents a Mapper used to convert Model Materials into Unity Materials.
void TriLibCore.Mappers.MaterialMapper.ApplyMaterialToRenderer | ( | MaterialRendererContext | materialRendererContext | ) |
Applies Material to the Renderer using the context data.
materialRendererContext | The Material Renderer Context, containing the Material and Unity Renderer. |
|
protected |
Creates the final Unity Material using the given context data.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
|
staticprotected |
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
texture | The TriLib Texture. |
textureLoaded | Indicates whether the Unity Texture has been loaded. |
|
staticprotected |
Applies the Texture scaling and offset, when applicable.
textureLoadingContext | The Texture Context containing Data from the original and the Unity Texture. |
|
virtual |
Gets the Diffuse Color Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Diffuse Texture Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Emission Color Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Glossiness or Roughness Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Glossiness or Roughness Texture Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Metallic Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Gets the Metallic Texture Property name.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
virtual |
Determines whether this Mapper is compatible with the given Material Renderer Context.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
true
if this Mapper is compatible with the given Material Renderer Context, otherwise, false
.Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
protected |
Loads a Texture using callbacks to be called on the main Thread later.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
textureType | The Texture Type. |
texture | The source Texture to load. |
onTextureProcessed | Callbacks to call when the Texture is processed. |
null
.
|
virtual |
Starts the mapping process, comparing the Mapper Properties against the source Material ones.
materialMapperContext | The source Material Mapper Context, containing the Virtual Material and Unity Material. |
Reimplemented in TriLibCore.Mappers.StandardMaterialMapper, TriLibCore.HDRP.Mappers.HDRPMaterialMapper, and TriLibCore.URP.Mappers.UniversalRPMaterialMapper.
|
static |
summary> The method to call to fix NPOT textures. /summary>
|
static |
summary> The method to call when the Mapper has to load a Texture. /summary>
|
static |
summary> The method to call to fix normal map textures. /summary>
|
static |
summary> The method to call to scan the texture for alpha pixels. /summary>
|
static |
summary> The method to call to apply texture CPU data. /summary>
|
get |
Gets the loading Material preset for this Mapper.
The loading Material preset.
|
get |
|
get |
|
get |
|
get |