Only clamp color if tsp.ColorClamp is set. Thanks p1pkin

This commit is contained in:
Flyinghead 2018-09-12 17:50:42 +02:00
parent fe4c310306
commit 2a8591798f
2 changed files with 13 additions and 8 deletions

View File

@ -171,6 +171,8 @@ __forceinline
else
ShaderUniforms.trilinear_alpha = 1.0;
bool color_clamp = gp->tsp.ColorClamp && (pvrrc.fog_clamp_min != 0 || pvrrc.fog_clamp_max != 0xffffffff);
CurrentShader = &gl.pogram_table[
GetProgramID(Type == ListType_Punch_Through ? 1 : 0,
SetTileClip(gp->tileclip, false) + 1,
@ -182,7 +184,7 @@ __forceinline
gp->tsp.FogCtrl,
gp->pcw.Gouraud,
gp->tcw.PixelFmt == PixelBumpMap,
pvrrc.fog_clamp_min != 0 || pvrrc.fog_clamp_max != 0xffffffff)];
color_clamp)];
if (CurrentShader->program == -1)
CompilePipelineShader(CurrentShader);

View File

@ -330,21 +330,24 @@ void main() \n\
#if pp_Offset==1 && pp_BumpMap == 0 \n\
{ \n\
color.rgb+=vtx_offs.rgb; \n\
if (pp_FogCtrl==1) \n\
{ \n\
color = fog_clamp(color); \n\
color.rgb=mix(color.rgb,sp_FOG_COL_VERT.rgb,vtx_offs.a); \n\
} \n\
} \n\
#endif\n\
} \n\
#endif\n\
#if pp_FogCtrl==0 \n\
\n\
color = fog_clamp(color); \n\
\n\
#if pp_FogCtrl == 0 \n\
{ \n\
color = fog_clamp(color); \n\
color.rgb=mix(color.rgb,sp_FOG_COL_RAM.rgb,fog_mode2(gl_FragCoord.w)); \n\
} \n\
#endif\n\
#if pp_FogCtrl == 1 && pp_Offset==1 && pp_BumpMap == 0 \n\
{ \n\
color.rgb=mix(color.rgb,sp_FOG_COL_VERT.rgb,vtx_offs.a); \n\
} \n\
#endif\n\
\n\
color *= trilinear_alpha; \n\
\n\
#if cp_AlphaTest == 1 \n\