diff --git a/CodeWalker.Shaders/BasicPS_Deferred.hlsl b/CodeWalker.Shaders/BasicPS_Deferred.hlsl index 6dcda36..bf6c7c3 100644 --- a/CodeWalker.Shaders/BasicPS_Deferred.hlsl +++ b/CodeWalker.Shaders/BasicPS_Deferred.hlsl @@ -34,8 +34,10 @@ PS_OUTPUT main(VS_OUTPUT input) } if (IsDistMap) c = float4(c.rgb * 2, (c.r + c.g + c.b) - 1); + if (IsDecal == 4) c.a = c.r; if ((IsDecal == 0) && (c.a <= 0.33)) discard; if ((IsDecal == 1) && (c.a <= 0.0)) discard; + if ((IsDecal >= 3) && (c.a <= 0.0)) discard; if (IsDecal == 0) c.a = 1; if (IsDecal == 2) { @@ -49,7 +51,7 @@ PS_OUTPUT main(VS_OUTPUT input) { c.rgb *= input.Tint.rgb; } - if (IsDecal == 1) + if ((IsDecal == 1) || (IsDecal >= 3)) { c.a *= input.Colour0.a; } @@ -157,12 +159,16 @@ PS_OUTPUT main(VS_OUTPUT input) c.a = saturate(c.a); + float4 a = c.aaaa; + if(IsDecal==3) a.xzw = 0; //normal_only + if(IsDecal==4) a.xyw = 0; //spec_only + PS_OUTPUT output; - output.Diffuse = c; - output.Normal = float4(saturate(norm * 0.5 + 0.5), c.a); - output.Specular = float4(spec, c.a); - output.Irradiance = float4(input.Colour0.rg, emiss, c.a); + output.Diffuse = float4(c.rgb, a.x); + output.Normal = float4(saturate(norm * 0.5 + 0.5), a.y); + output.Specular = float4(spec, a.z); + output.Irradiance = float4(input.Colour0.rg, emiss, a.w); return output; } diff --git a/Rendering/Shaders/BasicShader.cs b/Rendering/Shaders/BasicShader.cs index b229667..ff45b59 100644 --- a/Rendering/Shaders/BasicShader.cs +++ b/Rendering/Shaders/BasicShader.cs @@ -730,11 +730,16 @@ namespace CodeWalker.Rendering case 731050667: //weapon_normal_spec_palette.sps if (usetint) { tintflag = 0; pstintflag = 2; } //use diffuse sampler alpha for tint lookup! break; - case 3880384844://{decal_spec_only.sps}w - case 600733812://{decal_amb_only.sps} - case 2842248626://{spec_decal.sps} - case 2457676400://{reflect_decal.sps} + case 341123999://{decal_normal_only.sps} case 2706821972://{mirror_decal.sps} + case 2457676400://{reflect_decal.sps} + decalflag = 3; + break; + case 3880384844://{decal_spec_only.sps} + case 2842248626://{spec_decal.sps} + decalflag = 4; + break; + case 600733812://{decal_amb_only.sps} //if (RenderMode == WorldRenderMode.Default) usediff = false; break; case 2655725442://{decal_dirt.sps} diff --git a/Shaders/BasicPS_Deferred.cso b/Shaders/BasicPS_Deferred.cso index 8dd453c..f98285b 100644 Binary files a/Shaders/BasicPS_Deferred.cso and b/Shaders/BasicPS_Deferred.cso differ