mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-24 06:57:49 -05:00
fix rebase
This commit is contained in:
parent
2c9bb63ccb
commit
1d38656df2
|
|
@ -37,7 +37,7 @@ namespace UniGLTF
|
|||
EnumerateTexturesFromUri(externalObjectMap, parser, UnityPath.FromUnityPath(scriptedImporter.assetPath).Parent))))
|
||||
{
|
||||
// settings TextureImporters
|
||||
foreach (var textureInfo in parser.EnumerateTextures())
|
||||
foreach (var textureInfo in GltfTextureEnumerator.Enumerate(parser.GLTF))
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, loaded.TextureFactory.ExternalMap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace UniGLTF
|
|||
{
|
||||
public static IEnumerable<GetTextureParam> EnumerateTextures(glTF gltf, glTFMaterial m)
|
||||
{
|
||||
int? metallicRoughnessTexture = default;
|
||||
if (m.pbrMetallicRoughness != null)
|
||||
{
|
||||
// base color
|
||||
|
|
@ -17,16 +18,16 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
// metallic roughness
|
||||
if (m.pbrMetallicRoughness?.metallicRoughnessTexture != null)
|
||||
if (m.pbrMetallicRoughness?.metallicRoughnessTexture != null && m.pbrMetallicRoughness.metallicRoughnessTexture.index != -1)
|
||||
{
|
||||
yield return PBRMaterialItem.MetallicRoughnessTexture(gltf, m);
|
||||
metallicRoughnessTexture = m.pbrMetallicRoughness?.metallicRoughnessTexture?.index;
|
||||
}
|
||||
}
|
||||
|
||||
// emission
|
||||
if (m.emissiveTexture != null)
|
||||
{
|
||||
yield return GetTextureParam.Create(gltf, m.emissiveTexture.index);
|
||||
yield return GetTextureParam.CreateSRGB(gltf, m.emissiveTexture.index);
|
||||
}
|
||||
|
||||
// normal
|
||||
|
|
@ -36,9 +37,16 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
// occlusion
|
||||
if (m.occlusionTexture != null)
|
||||
int? occlusionTexture = default;
|
||||
if (m.occlusionTexture != null && m.occlusionTexture.index != -1)
|
||||
{
|
||||
yield return PBRMaterialItem.OcclusionTexture(gltf, m);
|
||||
occlusionTexture = m.occlusionTexture.index;
|
||||
}
|
||||
|
||||
// metallicSmooth and occlusion
|
||||
if (metallicRoughnessTexture.HasValue || occlusionTexture.HasValue)
|
||||
{
|
||||
yield return PBRMaterialItem.StandardTexture(gltf, m);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace VRM
|
|||
using (var context = new VRMImporterContext(parser))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var textureInfo in parser.EnumerateTextures())
|
||||
foreach (var textureInfo in new VRMTextureEnumerator(context.VRM).Enumerate(parser.GLTF))
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, map.ToDictionary(x => x.name, x => x.texture as Texture2D));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace VRM
|
|||
using (var context = new VRMImporterContext(parser, null, map))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var textureInfo in parser.EnumerateTextures())
|
||||
foreach (var textureInfo in new VRMTextureEnumerator(context.VRM).Enumerate(parser.GLTF))
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, map.ToDictionary(x => x.name, x => x.texture as Texture2D));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace VRM
|
|||
foreach (var kv in vrmMaterial.textureProperties)
|
||||
{
|
||||
// SRGB color or normalmap
|
||||
yield return GetTextureParam.Create(gltf, kv.Value, kv.Key);
|
||||
yield return GetTextureParam.Create(gltf, kv.Value, kv.Key, default, default);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -38,7 +38,7 @@ namespace VRM
|
|||
// thumbnail
|
||||
if (m_vrm.meta != null && m_vrm.meta.texture != -1)
|
||||
{
|
||||
yield return GetTextureParam.Create(gltf, m_vrm.meta.texture);
|
||||
yield return GetTextureParam.CreateSRGB(gltf, m_vrm.meta.texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user