diff --git a/rpcs3/Emu/RSX/Common/GLSLCommon.h b/rpcs3/Emu/RSX/Common/GLSLCommon.h index f93202431f..4b34d653d6 100644 --- a/rpcs3/Emu/RSX/Common/GLSLCommon.h +++ b/rpcs3/Emu/RSX/Common/GLSLCommon.h @@ -34,38 +34,37 @@ namespace program_common template_body += "$T fetch_fog_value(uint mode, $T $I)\n"; template_body += "{\n"; - template_body += " $T result = $T(0., 0., 0., 0.);\n"; + template_body += " $T result = $T($I.x, 0., 0., 0.);\n"; template_body += " switch(mode)\n"; template_body += " {\n"; template_body += " default:\n"; template_body += " return result;\n"; template_body += " case 0:\n"; template_body += " //linear\n"; - template_body += " result = $T(fog_param1 * $I.x + (fog_param0 - 1.), fog_param1 * $I.x + (fog_param0 - 1.), 0., 0.);\n"; + template_body += " result.y = fog_param1 * $I.x + (fog_param0 - 1.);\n"; template_body += " break;\n"; template_body += " case 1:\n"; template_body += " //exponential\n"; - template_body += " result = $T(11.084 * (fog_param1 * $I.x + fog_param0 - 1.5), exp(11.084 * (fog_param1 * $I.x + fog_param0 - 1.5)), 0., 0.);\n"; + template_body += " result.y = exp(11.084 * (fog_param1 * $I.x + fog_param0 - 1.5));\n"; template_body += " break;\n"; template_body += " case 2:\n"; template_body += " //exponential2\n"; - template_body += " result = $T(4.709 * (fog_param1 * $I.x + fog_param0 - 1.5), exp(-pow(4.709 * (fog_param1 * $I.x + fog_param0 - 1.5), 2.)), 0., 0.);\n"; + template_body += " result.y = exp(-pow(4.709 * (fog_param1 * $I.x + fog_param0 - 1.5), 2.));\n"; template_body += " break;\n"; template_body += " case 3:\n"; template_body += " //exponential_abs\n"; - template_body += " result = $T(11.084 * (fog_param1 * abs($I.x) + fog_param0 - 1.5), exp(11.084 * (fog_param1 * abs($I.x) + fog_param0 - 1.5)), 0., 0.);\n"; + template_body += " result.y = exp(11.084 * (fog_param1 * abs($I.x) + fog_param0 - 1.5));\n"; template_body += " break;\n"; template_body += " case 4:\n"; template_body += " //exponential2_abs\n"; - template_body += " result = $T(4.709 * (fog_param1 * abs($I.x) + fog_param0 - 1.5), exp(-pow(4.709 * (fog_param1 * abs($I.x) + fog_param0 - 1.5), 2.)), 0., 0.);\n"; + template_body += " result.y = exp(-pow(4.709 * (fog_param1 * abs($I.x) + fog_param0 - 1.5), 2.));\n"; template_body += " break;\n"; template_body += " case 5:\n"; template_body += " //linear_abs\n"; - template_body += " result = $T(fog_param1 * abs($I.x) + (fog_param0 - 1.), fog_param1 * abs($I.x) + (fog_param0 - 1.), 0., 0.);\n"; + template_body += " result.y = fog_param1 * abs($I.x) + (fog_param0 - 1.);\n"; template_body += " break;\n"; template_body += " }\n"; template_body += "\n"; - template_body += " result.x = max(result.x, 0.);\n"; template_body += " result.y = clamp(result.y, 0., 1.);\n"; template_body += " return result;\n"; template_body += "}\n\n";