From f227f30e04cdeeb55e1b5c59f11f2a332e8ae1cb Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 12 Sep 2020 15:44:38 -0400 Subject: [PATCH] Fixup BOTW switch samplers --- .../FileFormats/BFRES/BfresSwitch.cs | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/File_Format_Library/FileFormats/BFRES/BfresSwitch.cs b/File_Format_Library/FileFormats/BFRES/BfresSwitch.cs index dfa42568..45a1038a 100644 --- a/File_Format_Library/FileFormats/BFRES/BfresSwitch.cs +++ b/File_Format_Library/FileFormats/BFRES/BfresSwitch.cs @@ -747,7 +747,7 @@ namespace FirstPlugin Runtime.activeGame = Runtime.ActiveGame.MK8D; } - if (Runtime.activeGame == Runtime.ActiveGame.MK8D || Runtime.activeGame == Runtime.ActiveGame.BOTW) + if (Runtime.activeGame == Runtime.ActiveGame.MK8D) { if (useSampler == "_a0" && AlbedoCount == 0) { @@ -796,6 +796,37 @@ namespace FirstPlugin texture.Type = MatTexture.TextureType.Shadow; } } + else if (Runtime.activeGame == Runtime.ActiveGame.BOTW) { + if (useSampler == "_a0") + { + m.HasDiffuseMap = true; + texture.Type = MatTexture.TextureType.Diffuse; + } + else if (useSampler == "_n0") + { + m.HasNormalMap = true; + texture.Type = MatTexture.TextureType.Normal; + } + else if (texture.SamplerName == "_e0") + { + m.HasEmissionMap = true; + texture.Type = MatTexture.TextureType.Emission; + } + else if (texture.SamplerName == "_ao0") + { + m.HasSpecularMap = true; + texture.Type = MatTexture.TextureType.AO; + } + else if (texture.SamplerName == "_s0") + { + m.HasSpecularMap = true; + texture.Type = MatTexture.TextureType.Specular; + } + else if (texture.SamplerName == "_gn0") //Damage + { + + } + } else if (mat.ShaderAssign.ShaderArchiveName == "ssg") { bool IsAlbedo0 = texture.SamplerName == "_a0";