diff --git a/Rendering/Shaders/BasicShader.cs b/Rendering/Shaders/BasicShader.cs index b0e51ec..f9f87d9 100644 --- a/Rendering/Shaders/BasicShader.cs +++ b/Rendering/Shaders/BasicShader.cs @@ -54,11 +54,7 @@ namespace CodeWalker.Rendering } public struct BasicShaderPSGeomVars { - public uint EnableTexture; - public uint EnableTexture2; - public uint pad1; - public uint pad2; - public uint pad3; + public uint EnableTexture;//1+=diffuse1, 2+=diffuse2 public uint EnableTint; public uint EnableNormalMap; public uint EnableSpecMap; @@ -671,8 +667,7 @@ namespace CodeWalker.Rendering } - PSGeomVars.Vars.EnableTexture = usediff ? 1u : 0u; - PSGeomVars.Vars.EnableTexture2 = usediff2 ? 1u : 0u; + PSGeomVars.Vars.EnableTexture = (usediff ? 1u : 0u) + (usediff2 ? 2u : 0u); PSGeomVars.Vars.EnableTint = pstintflag; PSGeomVars.Vars.EnableNormalMap = usebump ? 1u : 0u; PSGeomVars.Vars.EnableSpecMap = usespec ? 1u : 0u; diff --git a/Shaders/BasicPS.cso b/Shaders/BasicPS.cso index 70a6f78..b2a88f6 100644 Binary files a/Shaders/BasicPS.cso and b/Shaders/BasicPS.cso differ diff --git a/Shaders/BasicPS.hlsl b/Shaders/BasicPS.hlsl index 9e452cc..ba3595c 100644 --- a/Shaders/BasicPS.hlsl +++ b/Shaders/BasicPS.hlsl @@ -18,11 +18,7 @@ cbuffer PSSceneVars : register(b0) } cbuffer PSGeomVars : register(b2) { - uint EnableTexture; - uint EnableTexture2; - uint pad1; - uint pad2; - uint pad3; + uint EnableTexture;//1+=diffuse1, 2+=diffuse2 uint EnableTint; uint EnableNormalMap; uint EnableSpecMap; @@ -68,7 +64,7 @@ float4 main(VS_OUTPUT input) : SV_TARGET { float4 c = float4(0.5, 0.5, 0.5, 1); if (RenderMode == 0) c = float4(1, 1, 1, 1); - if (EnableTexture == 1) + if (EnableTexture > 0) { float2 texc = input.Texcoord0; if (RenderMode >= 5) @@ -79,7 +75,7 @@ float4 main(VS_OUTPUT input) : SV_TARGET c = Colourmap.Sample(TextureSS, texc); - if (EnableTexture2 == 1) + if (EnableTexture > 1) //2+ enables diffuse2 { float4 c2 = Colourmap2.Sample(TextureSS, input.Texcoord1); c = c2.a * c2 + (1 - c2.a) * c; diff --git a/Shaders/BasicVS_PNCTT.cso b/Shaders/BasicVS_PNCTT.cso new file mode 100644 index 0000000..c9dfc71 Binary files /dev/null and b/Shaders/BasicVS_PNCTT.cso differ