1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-02-24 23:42:49 +01:00

fix underwater fog

This commit is contained in:
XProger 2018-09-15 02:24:07 +03:00
parent ab183997cf
commit 3c5eb00dbe
2 changed files with 8 additions and 4 deletions

View File

@ -384,7 +384,9 @@ namespace GAPI {
#endif
#ifndef _OS_CLOVER
strcat(defines, "#define OPT_TRAPEZOID\n"); // TODO: only for non Mali-400?
// TODO: only for non Mali-400?
strcat(defines, "#define OPT_TRAPEZOID\n");
strcat(defines, "#define OPT_UNDERWATER_FOG\n");
#endif
char fileName[255];

View File

@ -142,9 +142,11 @@ uniform vec4 uFogParams;
float fog;
#ifdef UNDERWATER
float d;
//if (uViewPos.y < uParam.y) // TODO: fix for mediump
// d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
//else
#ifdef OPT_UNDERWATER_FOG
if (uViewPos.y < uParam.y) // TODO: fix for mediump
d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
else
#endif
d = length(uViewPos.xyz - coord.xyz);
fog = d * WATER_FOG_DIST;
#else