GS/HW: Improve fog modulation accuracy in HW renderers

This commit is contained in:
refractionpcsx2
2026-01-16 00:53:43 +00:00
committed by lightningterror
parent 238b29836e
commit 6fc88a4499
5 changed files with 5 additions and 5 deletions

View File

@@ -740,7 +740,7 @@ float4 fog(float4 c, float f)
{
if(PS_FOG)
{
c.rgb = trunc(lerp(FogColor, c.rgb, f));
c.rgb = trunc(lerp(FogColor, c.rgb, (f * 255.0f) / 256.0f));
}
return c;

View File

@@ -646,7 +646,7 @@ bool atst(vec4 C)
void fog(inout vec4 C, float f)
{
#if PS_FOG != 0
C.rgb = trunc(mix(FogColor, C.rgb, f));
C.rgb = trunc(mix(FogColor, C.rgb, (f * 255.0f) / 256.0f));
#endif
}

View File

@@ -907,7 +907,7 @@ bool atst(vec4 C)
vec4 fog(vec4 c, float f)
{
#if PS_FOG
c.rgb = trunc(mix(FogColor, c.rgb, f));
c.rgb = trunc(mix(FogColor, c.rgb, (f * 255.0f) / 256.0f));
#endif
return c;

View File

@@ -790,7 +790,7 @@ struct PSMain
void fog(thread float4& C, float f)
{
if (PS_FOG)
C.rgb = trunc(mix(cb.fog_color, C.rgb, f));
C.rgb = trunc(mix(cb.fog_color, C.rgb, (f * 255.0f) / 256.0f));
}
float4 ps_color()

View File

@@ -3,4 +3,4 @@
/// Version number for GS and other shaders. Increment whenever any of the contents of the
/// shaders change, to invalidate the cache.
static constexpr u32 SHADER_CACHE_VERSION = 78;
static constexpr u32 SHADER_CACHE_VERSION = 79;