mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
GS/HW: Improve fog modulation accuracy in HW renderers
This commit is contained in:
committed by
lightningterror
parent
238b29836e
commit
6fc88a4499
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user