mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-27 21:34:38 -05:00
standard material fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user