mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 20:08:53 -05:00
mv MaterialImportParam MaterialDescriptor
This commit is contained in:
@@ -10,7 +10,7 @@ namespace UniGLTF
|
||||
/// </summary>
|
||||
public sealed class GltfMaterialImporter : IMaterialImporter
|
||||
{
|
||||
public MaterialImportParam GetMaterialParam(GltfParser parser, int i)
|
||||
public MaterialDescriptor GetMaterialParam(GltfParser parser, int i)
|
||||
{
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(parser, i, out var param))
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace UniGLTF
|
||||
#if VRM_DEVELOP
|
||||
Debug.LogWarning($"material: {i} out of range. fallback");
|
||||
#endif
|
||||
return new MaterialImportParam(GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
return new MaterialDescriptor(GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,16 +47,16 @@ namespace UniGLTF
|
||||
Transparent
|
||||
}
|
||||
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialImportParam param)
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialDescriptor matDesc)
|
||||
{
|
||||
if (i < 0 || i >= parser.GLTF.materials.Count)
|
||||
{
|
||||
param = default;
|
||||
matDesc = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
var src = parser.GLTF.materials[i];
|
||||
param = new MaterialImportParam(GltfMaterialImporter.GetMaterialName(i, src), ShaderName);
|
||||
matDesc = new MaterialDescriptor(GltfMaterialImporter.GetMaterialName(i, src), ShaderName);
|
||||
|
||||
var standardTexDesc = default(TextureDescriptor);
|
||||
if (src.pbrMetallicRoughness != null || src.occlusionTexture != null)
|
||||
@@ -69,7 +69,7 @@ namespace UniGLTF
|
||||
|
||||
if (src.pbrMetallicRoughness.baseColorFactor != null && src.pbrMetallicRoughness.baseColorFactor.Length == 4)
|
||||
{
|
||||
param.Colors.Add("_Color",
|
||||
matDesc.Colors.Add("_Color",
|
||||
src.pbrMetallicRoughness.baseColorFactor.ToColor4(ColorSpace.Linear, ColorSpace.sRGB)
|
||||
);
|
||||
}
|
||||
@@ -77,42 +77,42 @@ namespace UniGLTF
|
||||
if (src.pbrMetallicRoughness.baseColorTexture != null && src.pbrMetallicRoughness.baseColorTexture.index != -1)
|
||||
{
|
||||
var (key, textureParam) = GltfPbrTextureImporter.BaseColorTexture(parser, src);
|
||||
param.TextureSlots.Add("_MainTex", textureParam);
|
||||
matDesc.TextureSlots.Add("_MainTex", textureParam);
|
||||
}
|
||||
|
||||
if (src.pbrMetallicRoughness.metallicRoughnessTexture != null && src.pbrMetallicRoughness.metallicRoughnessTexture.index != -1)
|
||||
{
|
||||
param.Actions.Add(material => material.EnableKeyword("_METALLICGLOSSMAP"));
|
||||
param.TextureSlots.Add("_MetallicGlossMap", standardTexDesc);
|
||||
matDesc.Actions.Add(material => material.EnableKeyword("_METALLICGLOSSMAP"));
|
||||
matDesc.TextureSlots.Add("_MetallicGlossMap", standardTexDesc);
|
||||
// Set 1.0f as hard-coded. See: https://github.com/dwango/UniVRM/issues/212.
|
||||
param.FloatValues.Add("_Metallic", 1.0f);
|
||||
param.FloatValues.Add("_GlossMapScale", 1.0f);
|
||||
matDesc.FloatValues.Add("_Metallic", 1.0f);
|
||||
matDesc.FloatValues.Add("_GlossMapScale", 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
param.FloatValues.Add("_Metallic", src.pbrMetallicRoughness.metallicFactor);
|
||||
param.FloatValues.Add("_Glossiness", 1.0f - src.pbrMetallicRoughness.roughnessFactor);
|
||||
matDesc.FloatValues.Add("_Metallic", src.pbrMetallicRoughness.metallicFactor);
|
||||
matDesc.FloatValues.Add("_Glossiness", 1.0f - src.pbrMetallicRoughness.roughnessFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if (src.normalTexture != null && src.normalTexture.index != -1)
|
||||
{
|
||||
param.Actions.Add(material => material.EnableKeyword("_NORMALMAP"));
|
||||
matDesc.Actions.Add(material => material.EnableKeyword("_NORMALMAP"));
|
||||
var (key, textureParam) = GltfPbrTextureImporter.NormalTexture(parser, src);
|
||||
param.TextureSlots.Add("_BumpMap", textureParam);
|
||||
param.FloatValues.Add("_BumpScale", src.normalTexture.scale);
|
||||
matDesc.TextureSlots.Add("_BumpMap", textureParam);
|
||||
matDesc.FloatValues.Add("_BumpScale", src.normalTexture.scale);
|
||||
}
|
||||
|
||||
if (src.occlusionTexture != null && src.occlusionTexture.index != -1)
|
||||
{
|
||||
param.TextureSlots.Add("_OcclusionMap", standardTexDesc);
|
||||
param.FloatValues.Add("_OcclusionStrength", src.occlusionTexture.strength);
|
||||
matDesc.TextureSlots.Add("_OcclusionMap", standardTexDesc);
|
||||
matDesc.FloatValues.Add("_OcclusionStrength", src.occlusionTexture.strength);
|
||||
}
|
||||
|
||||
if (src.emissiveFactor != null
|
||||
|| (src.emissiveTexture != null && src.emissiveTexture.index != -1))
|
||||
{
|
||||
param.Actions.Add(material =>
|
||||
matDesc.Actions.Add(material =>
|
||||
{
|
||||
material.EnableKeyword("_EMISSION");
|
||||
material.globalIlluminationFlags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack;
|
||||
@@ -120,7 +120,7 @@ namespace UniGLTF
|
||||
|
||||
if (src.emissiveFactor != null && src.emissiveFactor.Length == 3)
|
||||
{
|
||||
param.Colors.Add("_EmissionColor",
|
||||
matDesc.Colors.Add("_EmissionColor",
|
||||
src.emissiveFactor.ToColor3(ColorSpace.Linear, ColorSpace.Linear)
|
||||
);
|
||||
}
|
||||
@@ -128,11 +128,11 @@ namespace UniGLTF
|
||||
if (src.emissiveTexture != null && src.emissiveTexture.index != -1)
|
||||
{
|
||||
var (key, textureParam) = GltfPbrTextureImporter.EmissiveTexture(parser, src);
|
||||
param.TextureSlots.Add("_EmissionMap", textureParam);
|
||||
matDesc.TextureSlots.Add("_EmissionMap", textureParam);
|
||||
}
|
||||
}
|
||||
|
||||
param.Actions.Add(material =>
|
||||
matDesc.Actions.Add(material =>
|
||||
{
|
||||
BlendMode blendMode = BlendMode.Opaque;
|
||||
// https://forum.unity.com/threads/standard-material-shader-ignoring-setfloat-property-_mode.344557/#post-2229980
|
||||
|
||||
@@ -8,41 +8,41 @@ namespace UniGLTF
|
||||
{
|
||||
public const string ShaderName = "UniGLTF/UniUnlit";
|
||||
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialImportParam param)
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialDescriptor matDesc)
|
||||
{
|
||||
if (i < 0 || i >= parser.GLTF.materials.Count)
|
||||
{
|
||||
param = default;
|
||||
matDesc = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
var src = parser.GLTF.materials[i];
|
||||
if (!glTF_KHR_materials_unlit.IsEnable(src))
|
||||
{
|
||||
param = default;
|
||||
matDesc = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
param = new MaterialImportParam(GltfMaterialImporter.GetMaterialName(i, src), ShaderName);
|
||||
matDesc = new MaterialDescriptor(GltfMaterialImporter.GetMaterialName(i, src), ShaderName);
|
||||
|
||||
// texture
|
||||
if (src.pbrMetallicRoughness.baseColorTexture != null)
|
||||
{
|
||||
var (offset, scale) = GltfTextureImporter.GetTextureOffsetAndScale(src.pbrMetallicRoughness.baseColorTexture);
|
||||
var (key, textureParam) = GltfTextureImporter.CreateSRGB(parser, src.pbrMetallicRoughness.baseColorTexture.index, offset, scale);
|
||||
param.TextureSlots.Add("_MainTex", textureParam);
|
||||
matDesc.TextureSlots.Add("_MainTex", textureParam);
|
||||
}
|
||||
|
||||
// color
|
||||
if (src.pbrMetallicRoughness.baseColorFactor != null && src.pbrMetallicRoughness.baseColorFactor.Length == 4)
|
||||
{
|
||||
param.Colors.Add("_Color",
|
||||
matDesc.Colors.Add("_Color",
|
||||
src.pbrMetallicRoughness.baseColorFactor.ToColor4(ColorSpace.Linear, ColorSpace.sRGB)
|
||||
);
|
||||
}
|
||||
|
||||
//renderMode
|
||||
param.Actions.Add(material =>
|
||||
matDesc.Actions.Add(material =>
|
||||
{
|
||||
if (src.alphaMode == "OPAQUE")
|
||||
{
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace UniGLTF
|
||||
/// </summary>
|
||||
public interface IMaterialImporter
|
||||
{
|
||||
MaterialImportParam GetMaterialParam(GltfParser parser, int i);
|
||||
MaterialDescriptor GetMaterialParam(GltfParser parser, int i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace UniGLTF
|
||||
{
|
||||
public static class MaterialImporterParamExtensions
|
||||
{
|
||||
public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateSubAssetKeyValue(this MaterialImportParam param)
|
||||
public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateSubAssetKeyValue(this MaterialDescriptor matDesc)
|
||||
{
|
||||
foreach (var kv in param.TextureSlots)
|
||||
foreach (var kv in matDesc.TextureSlots)
|
||||
{
|
||||
yield return (kv.Value.SubAssetKey, kv.Value);
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace VRM
|
||||
{
|
||||
public static class VRMMToonMaterialImporter
|
||||
{
|
||||
public static bool TryCreateParam(GltfParser parser, glTF_VRM_extensions vrm, int materialIdx, out MaterialImportParam param)
|
||||
public static bool TryCreateParam(GltfParser parser, glTF_VRM_extensions vrm, int materialIdx, out MaterialDescriptor matDesc)
|
||||
{
|
||||
var vrmMaterial = vrm.materialProperties[materialIdx];
|
||||
if (vrmMaterial.shader == VRM.glTF_VRM_Material.VRM_USE_GLTFSHADER)
|
||||
{
|
||||
// fallback to gltf
|
||||
param = default;
|
||||
matDesc = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ namespace VRM
|
||||
//
|
||||
// use material.name, because material name may renamed in GltfParser.
|
||||
var name = parser.GLTF.materials[materialIdx].name;
|
||||
param = new MaterialImportParam(name, vrmMaterial.shader);
|
||||
matDesc = new MaterialDescriptor(name, vrmMaterial.shader);
|
||||
|
||||
param.RenderQueue = vrmMaterial.renderQueue;
|
||||
matDesc.RenderQueue = vrmMaterial.renderQueue;
|
||||
|
||||
foreach (var kv in vrmMaterial.floatProperties)
|
||||
{
|
||||
param.FloatValues.Add(kv.Key, kv.Value);
|
||||
matDesc.FloatValues.Add(kv.Key, kv.Value);
|
||||
}
|
||||
|
||||
foreach (var kv in vrmMaterial.vectorProperties)
|
||||
@@ -36,7 +36,7 @@ namespace VRM
|
||||
if (!vrmMaterial.textureProperties.ContainsKey(kv.Key))
|
||||
{
|
||||
var v = new Vector4(kv.Value[0], kv.Value[1], kv.Value[2], kv.Value[3]);
|
||||
param.Vectors.Add(kv.Key, v);
|
||||
matDesc.Vectors.Add(kv.Key, v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace VRM
|
||||
{
|
||||
if (VRMMToonTextureImporter.TryGetTextureFromMaterialProperty(parser, vrm, materialIdx, kv.Key, out var texture))
|
||||
{
|
||||
param.TextureSlots.Add(kv.Key, texture.Item2);
|
||||
matDesc.TextureSlots.Add(kv.Key, texture.Item2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,24 +52,24 @@ namespace VRM
|
||||
{
|
||||
if (kv.Value)
|
||||
{
|
||||
param.Actions.Add(material => material.EnableKeyword(kv.Key));
|
||||
matDesc.Actions.Add(material => material.EnableKeyword(kv.Key));
|
||||
}
|
||||
else
|
||||
{
|
||||
param.Actions.Add(material => material.DisableKeyword(kv.Key));
|
||||
matDesc.Actions.Add(material => material.DisableKeyword(kv.Key));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var kv in vrmMaterial.tagMap)
|
||||
{
|
||||
param.Actions.Add(material => material.SetOverrideTag(kv.Key, kv.Value));
|
||||
matDesc.Actions.Add(material => material.SetOverrideTag(kv.Key, kv.Value));
|
||||
}
|
||||
|
||||
if (vrmMaterial.shader == MToon.Utils.ShaderName)
|
||||
{
|
||||
// TODO: Material拡張にMToonの項目が追加されたら旧バージョンのshaderPropから変換をかける
|
||||
// インポート時にUniVRMに含まれるMToonのバージョンに上書きする
|
||||
param.FloatValues[MToon.Utils.PropVersion] = MToon.Utils.VersionNumber;
|
||||
matDesc.FloatValues[MToon.Utils.PropVersion] = MToon.Utils.VersionNumber;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -14,26 +14,26 @@ namespace VRM
|
||||
m_vrm = vrm;
|
||||
}
|
||||
|
||||
public MaterialImportParam GetMaterialParam(GltfParser parser, int i)
|
||||
public MaterialDescriptor GetMaterialParam(GltfParser parser, int i)
|
||||
{
|
||||
// mtoon
|
||||
if (!VRMMToonMaterialImporter.TryCreateParam(parser, m_vrm, i, out MaterialImportParam param))
|
||||
if (!VRMMToonMaterialImporter.TryCreateParam(parser, m_vrm, i, out MaterialDescriptor matDesc))
|
||||
{
|
||||
// unlit
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(parser, i, out param))
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(parser, i, out matDesc))
|
||||
{
|
||||
// pbr
|
||||
if (!GltfPbrMaterialImporter.TryCreateParam(parser, i, out param))
|
||||
if (!GltfPbrMaterialImporter.TryCreateParam(parser, i, out matDesc))
|
||||
{
|
||||
// fallback
|
||||
#if VRM_DEVELOP
|
||||
Debug.LogWarning($"material: {i} out of range. fallback");
|
||||
#endif
|
||||
return new MaterialImportParam(GltfMaterialImporter.GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
return new MaterialDescriptor(GltfMaterialImporter.GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return param;
|
||||
return matDesc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace VRM
|
||||
var importer = new VRMImporterContext(parser, null);
|
||||
|
||||
Assert.AreEqual(73, parser.GLTF.materials.Count);
|
||||
Assert.True(VRMMToonMaterialImporter.TryCreateParam(parser, importer.VRM, 0, out MaterialImportParam param));
|
||||
Assert.True(VRMMToonMaterialImporter.TryCreateParam(parser, importer.VRM, 0, out MaterialDescriptor matDesc));
|
||||
}
|
||||
|
||||
static string AliciaPath
|
||||
|
||||
@@ -17,43 +17,43 @@ namespace UniVRM10
|
||||
/// <summary>
|
||||
/// VMRC_materials_mtoon の場合にマテリアル生成情報を作成する
|
||||
/// </summary>
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialImportParam param)
|
||||
public static bool TryCreateParam(GltfParser parser, int i, out MaterialDescriptor matDesc)
|
||||
{
|
||||
var m = parser.GLTF.materials[i];
|
||||
if (!UniGLTF.Extensions.VRMC_materials_mtoon.GltfDeserializer.TryGet(m.extensions,
|
||||
out UniGLTF.Extensions.VRMC_materials_mtoon.VRMC_materials_mtoon mtoon))
|
||||
{
|
||||
// Fallback to glTF, when MToon extension does not exist.
|
||||
param = default;
|
||||
matDesc = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
// use material.name, because material name may renamed in GltfParser.
|
||||
param = new MaterialImportParam(m.name, MToon.Utils.ShaderName);
|
||||
matDesc = new MaterialDescriptor(m.name, MToon.Utils.ShaderName);
|
||||
|
||||
foreach (var (key, (subAssetKey, value)) in Vrm10MToonTextureImporter.EnumerateAllTextures(parser, m, mtoon))
|
||||
{
|
||||
param.TextureSlots.Add(key, value);
|
||||
matDesc.TextureSlots.Add(key, value);
|
||||
}
|
||||
|
||||
foreach (var (key, value) in TryGetAllColors(m, mtoon))
|
||||
{
|
||||
param.Colors.Add(key, value);
|
||||
matDesc.Colors.Add(key, value);
|
||||
}
|
||||
|
||||
foreach (var (key, value) in TryGetAllFloats(m, mtoon))
|
||||
{
|
||||
param.FloatValues.Add(key, value);
|
||||
matDesc.FloatValues.Add(key, value);
|
||||
}
|
||||
|
||||
foreach (var (key, value) in TryGetAllFloatArrays(m, mtoon))
|
||||
{
|
||||
param.Vectors.Add(key, value);
|
||||
matDesc.Vectors.Add(key, value);
|
||||
}
|
||||
|
||||
param.RenderQueue = TryGetRenderQueue(m, mtoon);
|
||||
matDesc.RenderQueue = TryGetRenderQueue(m, mtoon);
|
||||
|
||||
param.Actions.Add(material =>
|
||||
matDesc.Actions.Add(material =>
|
||||
{
|
||||
// Set hidden properties, keywords from float properties.
|
||||
MToon.Utils.ValidateProperties(material, isBlendModeChangedByUser: false);
|
||||
|
||||
@@ -6,26 +6,26 @@ namespace UniVRM10
|
||||
{
|
||||
public sealed class Vrm10MaterialImporter : IMaterialImporter
|
||||
{
|
||||
public MaterialImportParam GetMaterialParam(GltfParser parser, int i)
|
||||
public MaterialDescriptor GetMaterialParam(GltfParser parser, int i)
|
||||
{
|
||||
// mtoon
|
||||
if (!Vrm10MToonMaterialImporter.TryCreateParam(parser, i, out MaterialImportParam param))
|
||||
if (!Vrm10MToonMaterialImporter.TryCreateParam(parser, i, out MaterialDescriptor matDesc))
|
||||
{
|
||||
// unlit
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(parser, i, out param))
|
||||
if (!GltfUnlitMaterialImporter.TryCreateParam(parser, i, out matDesc))
|
||||
{
|
||||
// pbr
|
||||
if (!GltfPbrMaterialImporter.TryCreateParam(parser, i, out param))
|
||||
if (!GltfPbrMaterialImporter.TryCreateParam(parser, i, out matDesc))
|
||||
{
|
||||
// fallback
|
||||
#if VRM_DEVELOP
|
||||
Debug.LogWarning($"material: {i} out of range. fallback");
|
||||
#endif
|
||||
return new MaterialImportParam(GltfMaterialImporter.GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
return new MaterialDescriptor(GltfMaterialImporter.GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return param;
|
||||
return matDesc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
|
||||
namespace VRMShaders
|
||||
{
|
||||
public class MaterialImportParam
|
||||
public class MaterialDescriptor
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly string ShaderName;
|
||||
@@ -18,7 +18,7 @@ namespace VRMShaders
|
||||
|
||||
public SubAssetKey SubAssetKey => new SubAssetKey(SubAssetKey.MaterialType, Name);
|
||||
|
||||
public MaterialImportParam(string name, string shaderName)
|
||||
public MaterialDescriptor(string name, string shaderName)
|
||||
{
|
||||
Name = name;
|
||||
ShaderName = shaderName;
|
||||
@@ -96,9 +96,9 @@ namespace VRMShaders
|
||||
return m_materials[index].Asset;
|
||||
}
|
||||
|
||||
public async Task<Material> LoadAsync(MaterialImportParam param, GetTextureAsyncFunc getTexture)
|
||||
public async Task<Material> LoadAsync(MaterialDescriptor matDesc, GetTextureAsyncFunc getTexture)
|
||||
{
|
||||
if (m_externalMap.TryGetValue(param.SubAssetKey, out Material material))
|
||||
if (m_externalMap.TryGetValue(matDesc.SubAssetKey, out Material material))
|
||||
{
|
||||
m_materials.Add(new MaterialLoadInfo(material, true));
|
||||
return material;
|
||||
@@ -109,10 +109,10 @@ namespace VRMShaders
|
||||
getTexture = (_) => Task.FromResult<Texture>(null);
|
||||
}
|
||||
|
||||
material = new Material(Shader.Find(param.ShaderName));
|
||||
material.name = param.SubAssetKey.Name;
|
||||
material = new Material(Shader.Find(matDesc.ShaderName));
|
||||
material.name = matDesc.SubAssetKey.Name;
|
||||
|
||||
foreach(var kv in param.TextureSlots)
|
||||
foreach(var kv in matDesc.TextureSlots)
|
||||
{
|
||||
var texture = await getTexture(kv.Value);
|
||||
if(texture!=null){
|
||||
@@ -121,27 +121,27 @@ namespace VRMShaders
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var kv in param.Colors)
|
||||
foreach(var kv in matDesc.Colors)
|
||||
{
|
||||
material.SetColor(kv.Key, kv.Value);
|
||||
}
|
||||
|
||||
foreach(var kv in param.Vectors)
|
||||
foreach(var kv in matDesc.Vectors)
|
||||
{
|
||||
material.SetVector(kv.Key, kv.Value);
|
||||
}
|
||||
|
||||
foreach(var kv in param.FloatValues)
|
||||
foreach(var kv in matDesc.FloatValues)
|
||||
{
|
||||
material.SetFloat(kv.Key, kv.Value);
|
||||
}
|
||||
|
||||
if (param.RenderQueue.HasValue)
|
||||
if (matDesc.RenderQueue.HasValue)
|
||||
{
|
||||
material.renderQueue = param.RenderQueue.Value;
|
||||
material.renderQueue = matDesc.RenderQueue.Value;
|
||||
}
|
||||
|
||||
foreach(var action in param.Actions)
|
||||
foreach(var action in matDesc.Actions)
|
||||
{
|
||||
action(material);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user