PixelShaderGen: Process fog calculations with integer math.

This commit is contained in:
Tony Wasserka 2013-10-08 02:14:52 +02:00
parent 21eb482a6e
commit df94e62350
1 changed files with 2 additions and 1 deletions

View File

@ -1074,7 +1074,8 @@ static inline void WriteFog(T& out, pixel_shader_uid_data& uid_data)
WARN_LOG(VIDEO, "Unknown Fog Type! %08x", bpmem.fog.c_proj_fsel.fsel);
}
out.Write("\tiprev.rgb = int3(round(lerp(float3(iprev.rgb), " I_FOG"[0].rgb*255.0, fog)));\n");
out.Write("\tint ifog = int(round(fog * 256.0));\n");
out.Write("\tiprev.rgb = (iprev.rgb * (256 - ifog) + int(" I_FOG"[0].rgb * 256.0 * ifog)) >> 8;\n");
}
void GetPixelShaderUid(PixelShaderUid& object, DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components)