mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 11:59:26 -05:00
TextureEnumerationInUnknownShader
This commit is contained in:
@@ -76,5 +76,60 @@ namespace VRM
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TextureEnumerationInUnknownShader()
|
||||
{
|
||||
var parser = new GltfParser
|
||||
{
|
||||
GLTF = new glTF
|
||||
{
|
||||
images = new List<glTFImage>
|
||||
{
|
||||
new glTFImage{
|
||||
mimeType = "image/png",
|
||||
}
|
||||
},
|
||||
textures = new List<glTFTexture>
|
||||
{
|
||||
new glTFTexture{
|
||||
name = "texture0",
|
||||
source = 0,
|
||||
}
|
||||
},
|
||||
materials = new List<glTFMaterial>
|
||||
{
|
||||
new glTFMaterial{
|
||||
pbrMetallicRoughness = new glTFPbrMetallicRoughness{
|
||||
baseColorTexture = new glTFMaterialBaseColorTextureInfo{
|
||||
index = 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
var vrm = new glTF_VRM_extensions
|
||||
{
|
||||
materialProperties = new List<glTF_VRM_Material>
|
||||
{
|
||||
new glTF_VRM_Material
|
||||
{
|
||||
shader = "UnknownShader",
|
||||
textureProperties = new Dictionary<string, int>
|
||||
{
|
||||
{"_MainTex", 0},
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
// 2系統ある?
|
||||
Assert.IsTrue(VRMMToonMaterialImporter.TryCreateParam(parser, vrm, 0, out VRMShaders.MaterialDescriptor matDesc));
|
||||
Assert.AreEqual(1, matDesc.TextureSlots.Count);
|
||||
|
||||
var items = new VrmTextureDescriptorGenerator(parser, vrm).Get().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user