Class glTF2StandardMaterialMapper
Converts TriLib virtual materials of glTF2 assets into Unity Standard materials, using shader properties and material presets appropriate for the currently active render pipeline.
Inheritance
Object
ScriptableObject
MaterialMapper
glTF2StandardMaterialMapper
Inherited Members
MaterialMapper.CheckingOrder
MaterialMapper.DisableAlpha
MaterialMapper.ApplyMaterialToRenderer(MaterialRendererContext)
MaterialMapper.Cleanup(MaterialRendererContext)
MaterialMapper.Map(MaterialMapperContext)
MaterialMapper.CheckTextureOffsetAndScaling(TextureLoadingContext)
MaterialMapper.CheckTextureOffsetAndScalingCoroutine(TextureLoadingContext)
MaterialMapper.BuildMaterial(MaterialMapperContext)
MaterialMapper.RegisteredMapperNamespaces
MaterialMapper.RegisteredMappers
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.ToString()
Object.name
Object.hideFlags
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
[Serializable]
[CreateAssetMenu(menuName = "TriLib/Mappers/Material/glTF2 Standard Material Mapper", fileName = "glTF2StandardMaterialMapper")]
public class glTF2StandardMaterialMapper : StandardMaterialMapper
Remarks
This mapper supports both the specular-glossiness and metallic-roughness workflows. Based on the flag UsingSpecularGlossiness, it selects a material preset from HDRP, URP, or Standard resource directories. It forces the use of a shader variant collection and extracts metallic and smoothness properties. The mapper is considered compatible if the reader is a TriLibCore.Gltf.Reader.GltfReader.
Fields
UsingSpecularGlossiness
Declaration
protected bool UsingSpecularGlossiness
Field Value
Type | Description |
---|---|
bool |
Properties
CutoutMaterialPreset
Declaration
public override Material CutoutMaterialPreset { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
CutoutMaterialPresetNoMetallicTexture
Declaration
public override Material CutoutMaterialPresetNoMetallicTexture { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
ExtractMetallicAndSmoothness
Declaration
public override bool ExtractMetallicAndSmoothness { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
LoadingMaterial
Declaration
public override Material LoadingMaterial { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
MaterialPreset
Declaration
public override Material MaterialPreset { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
MaterialPresetNoMetallicTexture
Declaration
public override Material MaterialPresetNoMetallicTexture { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
TransparentComposeMaterialPreset
Declaration
public override Material TransparentComposeMaterialPreset { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
TransparentComposeMaterialPresetNoMetallicTexture
Declaration
public override Material TransparentComposeMaterialPresetNoMetallicTexture { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
TransparentMaterialPreset
Declaration
public override Material TransparentMaterialPreset { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
TransparentMaterialPresetNoMetallicTexture
Declaration
public override Material TransparentMaterialPresetNoMetallicTexture { get; }
Property Value
Type | Description |
---|---|
Material |
Overrides
UseShaderVariantCollection
Declaration
public override bool UseShaderVariantCollection { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
ApplyGlossinessMapTexture(TextureLoadingContext)
Declaration
protected override IEnumerable ApplyGlossinessMapTexture(TextureLoadingContext textureLoadingContext)
Parameters
Type | Name | Description |
---|---|---|
TextureLoadingContext | textureLoadingContext |
Returns
Type | Description |
---|---|
IEnumerable |
Overrides
IsCompatible(MaterialMapperContext)
Declaration
public override bool IsCompatible(MaterialMapperContext materialMapperContext)
Parameters
Type | Name | Description |
---|---|---|
MaterialMapperContext | materialMapperContext |
Returns
Type | Description |
---|---|
bool |
Overrides
MapCoroutine(MaterialMapperContext)
Declaration
public override IEnumerable MapCoroutine(MaterialMapperContext materialMapperContext)
Parameters
Type | Name | Description |
---|---|---|
MaterialMapperContext | materialMapperContext |
Returns
Type | Description |
---|---|
IEnumerable |