1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-13 16:44:50 +02:00

disable underwater fog for low water detail preset

This commit is contained in:
XProger
2018-11-15 06:45:03 +03:00
parent 4307603bc2
commit e1d3c277a1
3 changed files with 6 additions and 7 deletions

View File

@@ -394,7 +394,8 @@ namespace GAPI {
#ifndef _OS_CLOVER
// TODO: only for non Mali-400?
strcat(defines, "#define OPT_TRAPEZOID\n");
strcat(defines, "#define OPT_UNDERWATER_FOG\n");
if (Core::settings.detail.water > Core::Settings::LOW)
strcat(defines, "#define OPT_UNDERWATER_FOG\n");
#endif
char fileName[255];

View File

@@ -687,14 +687,14 @@ struct MeshBuilder {
void roomRemoveWaterSurfaces(TR::Room &room, int &iCount, int &vCount) {
room.waterLevel = -1;
if (Core::settings.detail.water == Core::Settings::LOW) {
for (int i = 0; i < room.data.fCount; i++)
room.data.faces[i].water = false;
return;
}
room.waterLevel = -1;
for (int i = 0; i < room.data.fCount; i++) {
TR::Face &f = room.data.faces[i];
if (f.water) continue;

View File

@@ -140,13 +140,11 @@ uniform vec4 uFogParams;
#endif
float fog;
#ifdef UNDERWATER
#if defined(UNDERWATER) && defined(OPT_UNDERWATER_FOG)
float d;
#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
@@ -481,7 +479,7 @@ uniform vec4 uFogParams;
color.xyz += calcSpecular(normal, vViewVec.xyz, vLightVec, uLightColor[0], rSpecular);
#endif
#ifdef UNDERWATER
#if defined(UNDERWATER) && defined(OPT_UNDERWATER_FOG)
color.xyz = mix(UNDERWATER_COLOR * 0.2, color.xyz, vNormal.w);
#else
color.xyz = mix(uFogParams.xyz, color.xyz, vNormal.w);