mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-27 21:34:38 -05:00
Merge branch 'master' of https://github.com/vrm-c/UniVRM into maintainExtensionSupportFlags
This commit is contained in:
@@ -32,6 +32,7 @@ namespace VRM
|
||||
ExportRenderingSettings(srcProps, dst);
|
||||
ExportBaseColor(src, srcProps, textureExporter, dst);
|
||||
ExportEmission(src, srcProps, textureExporter, dst);
|
||||
ExportNormal(src, srcProps, textureExporter, dst);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -116,6 +117,23 @@ namespace VRM
|
||||
}
|
||||
}
|
||||
|
||||
private static void ExportNormal(Material srcMaterial, MToonDefinition src, ITextureExporter textureExporter, glTFMaterial dst)
|
||||
{
|
||||
if (src.Lighting.Normal.NormalTexture != null)
|
||||
{
|
||||
var index = textureExporter.RegisterExportingAsNormal(src.Lighting.Normal.NormalTexture);
|
||||
if (index != -1)
|
||||
{
|
||||
dst.normalTexture = new glTFMaterialNormalTextureInfo()
|
||||
{
|
||||
index = index,
|
||||
scale = src.Lighting.Normal.NormalScaleValue,
|
||||
};
|
||||
ExportMainTextureTransform(srcMaterial, dst.normalTexture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ExportMainTextureTransform(Material src, glTFTextureInfo targetTextureInfo)
|
||||
{
|
||||
GltfMaterialExportUtils.ExportTextureTransform(src, targetTextureInfo, MToon.Utils.PropMainTex);
|
||||
|
||||
Reference in New Issue
Block a user