standard material fix

This commit is contained in:
junichi_hirose
2018-10-03 18:20:10 +09:00
parent 654f84a14c
commit 4d89c5ca4b
2 changed files with 6 additions and 15 deletions

View File

@@ -26,14 +26,6 @@ namespace VRM
"VRM/UnlitTransparentZWrite",
};
static bool UseConverted(bool isPlaying, string shader, string prop)
{
if (isPlaying && prop == "_BumpMap") return true;
if (prop == "_MetallicGlossMap") return true;
if (prop == "_OcclusionMap") return true;
return false;
}
public override Material CreateMaterial(int i, glTFMaterial src)
{
if(i==0 && m_materials.Count == 0)
@@ -92,7 +84,7 @@ namespace VRM
var texture = Context.GetTexture(kv.Value);
if (texture != null)
{
if(UseConverted(Application.isPlaying, shaderName, kv.Key))
if(texture.UseConverted(Application.isPlaying, shaderName, kv.Key))
{
material.SetTexture(kv.Key, texture.Converted);
}

View File

@@ -119,6 +119,11 @@ namespace VRM
}
else
{
foreach (var keyword in m.shaderKeywords)
{
material.keywordMap.Add(keyword, m.IsKeywordEnabled(keyword));
}
// get properties
//material.SetProp(prop);
foreach (var kv in prop.Properties)
@@ -175,12 +180,6 @@ namespace VRM
throw new NotImplementedException();
}
}
}
foreach (var keyword in m.shaderKeywords)
{
material.keywordMap.Add(keyword, m.IsKeywordEnabled(keyword));
}
foreach (var tag in TAGS)