Use EXP2 for fog to emulate hardware

This commit is contained in:
Jannik Vogel 2015-08-19 18:48:30 +02:00
parent 8ce4cf3dbc
commit 4894aace0e
1 changed files with 2 additions and 2 deletions

View File

@ -319,7 +319,7 @@ static QString* generate_fixed_function(const ShaderState state,
* fogParam[0] = 1.5
*/
qstring_append(s, "float fogFactor = fogParam[0] + exp(fogDistance * fogParam[1] * 2.0 * 5.5452);\n");
qstring_append(s, "float fogFactor = fogParam[0] + exp2(fogDistance * fogParam[1] * 16.0);\n");
qstring_append(s, "fogFactor -= 1.5;\n"); /* FIXME: WHHYYY?!! */
break;
case FOG_MODE_EXP2:
@ -330,7 +330,7 @@ static QString* generate_fixed_function(const ShaderState state,
* fogParam[0] = 1.5
*/
qstring_append(s, "float fogFactor = fogParam[0] + exp(-fogDistance * fogDistance * fogParam[1] * fogParam[1] * 4.0 * 5.5452);\n");
qstring_append(s, "float fogFactor = fogParam[0] + exp2(-fogDistance * fogDistance * fogParam[1] * fogParam[1] * 32.0);\n");
qstring_append(s, "fogFactor -= 1.5;\n"); /* FIXME: WHHYYY?!! */
break;
default: