mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 09:34:18 +02:00
disable underwater fog for low water detail preset
This commit is contained in:
@@ -394,6 +394,7 @@ namespace GAPI {
|
|||||||
#ifndef _OS_CLOVER
|
#ifndef _OS_CLOVER
|
||||||
// TODO: only for non Mali-400?
|
// TODO: only for non Mali-400?
|
||||||
strcat(defines, "#define OPT_TRAPEZOID\n");
|
strcat(defines, "#define OPT_TRAPEZOID\n");
|
||||||
|
if (Core::settings.detail.water > Core::Settings::LOW)
|
||||||
strcat(defines, "#define OPT_UNDERWATER_FOG\n");
|
strcat(defines, "#define OPT_UNDERWATER_FOG\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -687,14 +687,14 @@ struct MeshBuilder {
|
|||||||
|
|
||||||
void roomRemoveWaterSurfaces(TR::Room &room, int &iCount, int &vCount) {
|
void roomRemoveWaterSurfaces(TR::Room &room, int &iCount, int &vCount) {
|
||||||
|
|
||||||
|
room.waterLevel = -1;
|
||||||
|
|
||||||
if (Core::settings.detail.water == Core::Settings::LOW) {
|
if (Core::settings.detail.water == Core::Settings::LOW) {
|
||||||
for (int i = 0; i < room.data.fCount; i++)
|
for (int i = 0; i < room.data.fCount; i++)
|
||||||
room.data.faces[i].water = false;
|
room.data.faces[i].water = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
room.waterLevel = -1;
|
|
||||||
|
|
||||||
for (int i = 0; i < room.data.fCount; i++) {
|
for (int i = 0; i < room.data.fCount; i++) {
|
||||||
TR::Face &f = room.data.faces[i];
|
TR::Face &f = room.data.faces[i];
|
||||||
if (f.water) continue;
|
if (f.water) continue;
|
||||||
|
@@ -140,13 +140,11 @@ uniform vec4 uFogParams;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
float fog;
|
float fog;
|
||||||
#ifdef UNDERWATER
|
#if defined(UNDERWATER) && defined(OPT_UNDERWATER_FOG)
|
||||||
float d;
|
float d;
|
||||||
#ifdef OPT_UNDERWATER_FOG
|
|
||||||
if (uViewPos.y < uParam.y) // TODO: fix for mediump
|
if (uViewPos.y < uParam.y) // TODO: fix for mediump
|
||||||
d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
|
d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
d = length(uViewPos.xyz - coord.xyz);
|
d = length(uViewPos.xyz - coord.xyz);
|
||||||
fog = d * WATER_FOG_DIST;
|
fog = d * WATER_FOG_DIST;
|
||||||
#else
|
#else
|
||||||
@@ -481,7 +479,7 @@ uniform vec4 uFogParams;
|
|||||||
color.xyz += calcSpecular(normal, vViewVec.xyz, vLightVec, uLightColor[0], rSpecular);
|
color.xyz += calcSpecular(normal, vViewVec.xyz, vLightVec, uLightColor[0], rSpecular);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UNDERWATER
|
#if defined(UNDERWATER) && defined(OPT_UNDERWATER_FOG)
|
||||||
color.xyz = mix(UNDERWATER_COLOR * 0.2, color.xyz, vNormal.w);
|
color.xyz = mix(UNDERWATER_COLOR * 0.2, color.xyz, vNormal.w);
|
||||||
#else
|
#else
|
||||||
color.xyz = mix(uFogParams.xyz, color.xyz, vNormal.w);
|
color.xyz = mix(uFogParams.xyz, color.xyz, vNormal.w);
|
||||||
|
Reference in New Issue
Block a user