less restriction on emission

This commit is contained in:
4sval 2022-09-18 20:26:12 +02:00
parent 98a40fc2f1
commit 7cff932a81
2 changed files with 9 additions and 3 deletions

@ -1 +1 @@
Subproject commit d8d7c9769133ad66a365ecadbe1bc5bfbf133432
Subproject commit 807d471212cc7a5953223c337324943d0ae5281f

View File

@ -110,13 +110,19 @@ public class Section : IDisposable
}
if (Parameters.HasTopEmissiveTexture &&
Parameters.EmissiveColor is { A: > 0 } emissiveColor &&
Parameters.Emissive is UTexture2D { IsVirtual: false } emissive)
{
var mip = emissive.GetFirstMip();
TextureDecoder.DecodeTexture(mip, emissive.Format, emissive.isNormalMap, platform, out var data, out var colorType);
Textures[3] = new Texture(_gl, data, (uint) mip.SizeX, (uint) mip.SizeY, colorType, emissive);
EmissionColor = new Vector4(emissiveColor.R, emissiveColor.G, emissiveColor.B, emissiveColor.A);
if (Parameters.EmissiveColor is { A: > 0 } emissiveColor)
{
EmissionColor = new Vector4(emissiveColor.R, emissiveColor.G, emissiveColor.B, emissiveColor.A);
}
else
{
EmissionColor = Vector4.One;
}
}
}