FModel/FModel/Views/Snooper/Shading/TextureHelper.cs
Marlon 14e05da2e0
Some checks failed
FModel QA Builder / build (push) Has been cancelled
fixed line endings to lf to match editorconfig
2026-01-27 14:17:43 +01:00

74 lines
2.0 KiB
C#

using OpenTK.Graphics.OpenGL4;
namespace FModel.Views.Snooper.Shading;
public static class TextureHelper
{
/// <summary>
/// Red : Specular (not used anymore)
/// Green : Metallic
/// Blue : Roughness
/// </summary>
public static void FixChannels(string game, Texture texture)
{
switch (game)
{
// R: Whatever (AO / S / E / ...)
// G: Roughness
// B: Metallic
case "GAMEFACE":
case "HK_PROJECT":
case "COSMICSHAKE":
case "PHOENIX":
case "ATOMICHEART":
case "MULTIVERSUS":
case "BODYCAM":
case "TSLGAME":
{
texture.SwizzleMask =
[
(int) PixelFormat.Red,
(int) PixelFormat.Blue,
(int) PixelFormat.Green,
(int) PixelFormat.Alpha
];
break;
}
// R: Metallic
// G: Roughness
// B: Whatever (AO / S / E / ...)
case "SHOOTERGAME":
case "DIVINEKNOCKOUT":
case "MOONMAN":
case "SHF":
{
texture.SwizzleMask =
[
(int) PixelFormat.Blue,
(int) PixelFormat.Red,
(int) PixelFormat.Green,
(int) PixelFormat.Alpha
];
break;
}
// R: Roughness
// G: Metallic
// B: Whatever (AO / S / E / ...)
case "CCFF7R":
case "PJ033":
case "ABINFINITE":
{
texture.SwizzleMask =
[
(int) PixelFormat.Blue,
(int) PixelFormat.Green,
(int) PixelFormat.Red,
(int) PixelFormat.Alpha
];
break;
}
}
texture.Swizzle();
}
}