1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-11 15:45:05 +02:00

fix for for mediump, enable mipmaps for low filter settings

This commit is contained in:
XProger
2018-05-30 04:04:57 +03:00
parent dfdd112ba8
commit 04fce6da95
6 changed files with 16 additions and 15 deletions

View File

@@ -37,7 +37,7 @@
#define _GAPI_GL 1
#define _GAPI_GLES 1
//#define DYNGEOM_NO_VBO
#define DYNGEOM_NO_VBO
#elif __linux__
#define _OS_LINUX 1
#define _GAPI_GL 1

View File

@@ -633,8 +633,8 @@ namespace GAPI {
}
void setFilterQuality(int value) {
bool filter = value > Core::Settings::LOW;
bool mipmaps = value > Core::Settings::MEDIUM;
bool filter = (opt & OPT_NEAREST) == 0 && (value > Core::Settings::LOW);
bool mipmaps = (opt & OPT_MIPMAPS) != 0;
Core::active.textures[0] = NULL;
bind(0);

View File

@@ -39,6 +39,7 @@
#define LARA_SWIM_SPEED 50.0f
#define LARA_SWIM_FRICTION 1.0f
#define LARA_MIN_SPECULAR 0.03f
#define LARA_WET_SPECULAR 0.5f
#define LARA_WET_TIMER (LARA_WET_SPECULAR / 16.0f) // 4 sec
@@ -2813,10 +2814,10 @@ struct Lara : Character {
updateWeapon();
if (stand == STAND_UNDERWATER)
specular = 0.0f;
specular = LARA_MIN_SPECULAR;
else
if (specular > 0.0f)
specular = max(0.0f, specular - LARA_WET_TIMER * Core::deltaTime);
if (specular > LARA_MIN_SPECULAR)
specular = max(LARA_MIN_SPECULAR, specular - LARA_WET_TIMER * Core::deltaTime);
if (state == STATE_MIDAS_DEATH || state == STATE_MIDAS_USE) {
uint32 sparklesMask = getMidasMask();

View File

@@ -1,3 +1,3 @@
set -e
clang++ -std=c++11 -Os -s -g -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__CLOVER__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -o../../../bin/OpenLara
clang++ -std=c++11 -Os -s -g -marm -march=armv7ve -mtune=cortex-a7 -mfloat-abi=hard -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__CLOVER__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -o../../../bin/OpenLara
strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note

View File

@@ -66,7 +66,7 @@ bool sndInit() {
int err;
// In the perfect world ReedPlayer-Clover process
// will release ALSA devicbefore app running, but...
// will release ALSA device before app running, but...
for (int i = 0; i < 20; i++) { // 20 * 0.1 = 2 secs
sndOut = NULL;
if ((err = snd_pcm_open(&sndOut, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
@@ -581,10 +581,10 @@ LOG("start\n");
inputFree();
//sndFree();
//Game::deinit();
Game::deinit();
eglFree();
sndFree();
return 0;
}

View File

@@ -142,9 +142,9 @@ uniform vec4 uFogParams;
float fog;
#ifdef UNDERWATER
float d;
if (uViewPos.y < uParam.y)
d = abs((coord.y - uParam.y) / normalize(vViewVec.xyz).y);
else
//if (uViewPos.y < uParam.y) // TODO: fix for mediump
// d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
//else
d = length(uViewPos.xyz - coord.xyz);
fog = d * WATER_FOG_DIST;
#else
@@ -436,7 +436,7 @@ uniform vec4 uFogParams;
vec3 normal = normalize(vNormal.xyz);
#ifdef TYPE_ENTITY
float rSpecular = uMaterial.z + 0.03;
float rSpecular = uMaterial.z;
#endif
#ifdef OPT_SHADOW