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:
@@ -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];
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user