1
0
mirror of synced 2025-02-20 20:51:35 +01:00

A few more sampler fixes

This commit is contained in:
KillzXGaming 2019-07-07 15:43:35 -04:00
parent 1747e5976d
commit 7cb5af263c
5 changed files with 22 additions and 47 deletions

Binary file not shown.

View File

@ -503,6 +503,22 @@ namespace FirstPlugin
AlbedoCount++;
texture.Type = MatTexture.TextureType.Diffuse;
}
else if (useSampler == "s_diffuse")
{
m.HasDiffuseMap = true;
AlbedoCount++;
texture.Type = MatTexture.TextureType.Diffuse;
}
else if (useSampler == "s_normal")
{
m.HasNormalMap = true;
texture.Type = MatTexture.TextureType.Normal;
}
else if (useSampler == "s_specmask")
{
m.HasSpecularMap = true;
texture.Type = MatTexture.TextureType.Specular;
}
else if (useSampler == "_a1")
{
m.HasDiffuseLayer = true;
@ -549,63 +565,20 @@ namespace FirstPlugin
m.HasAmbientOcclusionMap = true;
}
}
else if (Runtime.activeGame == Runtime.ActiveGame.SMO)
{
if (useSampler == "_a0")
{
if (AlbedoCount == 0)
{
m.HasDiffuseMap = true;
AlbedoCount++;
texture.Type = MatTexture.TextureType.Diffuse;
}
}
else if (useSampler == "_n0")
{
m.HasNormalMap = true;
texture.Type = MatTexture.TextureType.Normal;
}
else if (useSampler == "_e0")
{
m.HasEmissionMap = true;
texture.Type = MatTexture.TextureType.Emission;
}
else if (TextureName.Contains("mtl"))
{
m.HasMetalnessMap = true;
texture.Type = MatTexture.TextureType.Metalness;
}
else if (TextureName.Contains("rgh"))
{
texture.Type = MatTexture.TextureType.Roughness;
m.HasRoughnessMap = true;
}
else if (TextureName.Contains("sss"))
{
texture.Type = MatTexture.TextureType.SubSurfaceScattering;
m.HasSubSurfaceScatteringMap = true;
}
else if (texture.SamplerName == "_ao0")
{
texture.Type = MatTexture.TextureType.AO;
m.HasAmbientOcclusionMap = true;
}
}
else
{
if (texture.SamplerName == "s_diffuse")
if (useSampler == "s_diffuse")
{
m.HasDiffuseMap = true;
AlbedoCount++;
texture.Type = MatTexture.TextureType.Diffuse;
}
else if (texture.SamplerName == "s_normal")
else if (useSampler == "s_normal")
{
m.HasNormalMap = true;
texture.Type = MatTexture.TextureType.Normal;
}
else if (texture.SamplerName == "s_specmask")
else if (useSampler == "s_specmask")
{
m.HasSpecularMap = true;
texture.Type = MatTexture.TextureType.Specular;
@ -616,7 +589,7 @@ namespace FirstPlugin
AlbedoCount++;
texture.Type = MatTexture.TextureType.Diffuse;
}
if (useSampler == "_n0")
else if (useSampler == "_n0")
{
m.HasNormalMap = true;
texture.Type = MatTexture.TextureType.Normal;
@ -678,6 +651,8 @@ namespace FirstPlugin
}
}
Console.WriteLine($"{useSampler} {texture.Type}");
texture.textureUnit = textureUnit++;
texture.Name = TextureName;