mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-02 19:27:50 +02:00
#23 considering luminosity in downsample filter
This commit is contained in:
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
@@ -22,9 +22,15 @@ uniform int uType;
|
|||||||
|
|
||||||
vec4 color = vec4(0.0);
|
vec4 color = vec4(0.0);
|
||||||
for (float y = -1.5; y < 2.0; y++)
|
for (float y = -1.5; y < 2.0; y++)
|
||||||
for (float x = -1.5; x < 2.0; x++)
|
for (float x = -1.5; x < 2.0; x++) {
|
||||||
color += texture2D(sDiffuse, vTexCoord + vec2(x, y) * k);
|
vec4 p;
|
||||||
color /= 16.0;
|
p.xyz = texture2D(sDiffuse, vTexCoord + vec2(x, y) * k).xyz;
|
||||||
|
p.w = dot(p.xyz, vec3(0.299, 0.587, 0.114));
|
||||||
|
p.xyz *= p.w;
|
||||||
|
color += p;
|
||||||
|
}
|
||||||
|
color.xyz /= color.w;
|
||||||
|
color.w = 1.0;
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ namespace Game {
|
|||||||
void init() {
|
void init() {
|
||||||
Core::init();
|
Core::init();
|
||||||
//level = new Level("LEVEL2_DEMO.PHD", true, false);
|
//level = new Level("LEVEL2_DEMO.PHD", true, false);
|
||||||
//level = new Level("GYM.PHD", false, true);
|
//level = new Level("GYM.PSX", false, true);
|
||||||
//level = new Level("LEVEL3A.PHD", false, false);
|
//level = new Level("LEVEL3A.PHD", false, false);
|
||||||
level = new Level("LEVEL2.PSX", false, false);
|
level = new Level("LEVEL2.PSX", false, false);
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#define DESCENT_SPEED 2048.0f
|
#define DESCENT_SPEED 2048.0f
|
||||||
#define MUZZLE_FLASH_TIME 0.1f
|
#define MUZZLE_FLASH_TIME 0.1f
|
||||||
#define FLASH_LIGHT_COLOR vec4(0.8f, 0.7f, 0.3f, 3584 * 3584)
|
#define FLASH_LIGHT_COLOR vec4(0.8f, 0.7f, 0.3f, 3072 * 3072)
|
||||||
#define TARGET_MAX_DIST (8.0f * 1024.0f)
|
#define TARGET_MAX_DIST (8.0f * 1024.0f)
|
||||||
|
|
||||||
struct Lara : Character {
|
struct Lara : Character {
|
||||||
@@ -290,6 +290,10 @@ struct Lara : Character {
|
|||||||
angle = vec3(0.0f, PI, 0.0f);
|
angle = vec3(0.0f, PI, 0.0f);
|
||||||
getEntity().room = 14;
|
getEntity().room = 14;
|
||||||
|
|
||||||
|
// level 8c
|
||||||
|
pos = vec3(40913, -1012, 42252);
|
||||||
|
angle = vec3(0.0f, PI, 0.0f);
|
||||||
|
getEntity().room = 0;
|
||||||
*/
|
*/
|
||||||
updateEntity();
|
updateEntity();
|
||||||
#endif
|
#endif
|
||||||
@@ -462,7 +466,7 @@ struct Lara : Character {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wpnChange(Weapon::Type wType) {
|
void wpnChange(Weapon::Type wType) {
|
||||||
if (wpnCurrent == wType) return;
|
if (wpnCurrent == wType || home) return;
|
||||||
wpnNext = wType;
|
wpnNext = wType;
|
||||||
wpnHide();
|
wpnHide();
|
||||||
}
|
}
|
||||||
|
@@ -855,7 +855,7 @@ struct Level {
|
|||||||
|
|
||||||
Debug::begin();
|
Debug::begin();
|
||||||
// Debug::Level::rooms(level, lara->pos, lara->getEntity().room);
|
// Debug::Level::rooms(level, lara->pos, lara->getEntity().room);
|
||||||
Debug::Level::lights(level, lara->getRoomIndex());
|
// Debug::Level::lights(level, lara->getRoomIndex());
|
||||||
// Debug::Level::sectors(level, lara->getRoomIndex(), (int)lara->pos.y);
|
// Debug::Level::sectors(level, lara->getRoomIndex(), (int)lara->pos.y);
|
||||||
// Debug::Level::portals(level);
|
// Debug::Level::portals(level);
|
||||||
// Debug::Level::meshes(level);
|
// Debug::Level::meshes(level);
|
||||||
@@ -866,7 +866,7 @@ struct Level {
|
|||||||
|
|
||||||
shadow->unbind(sShadow);
|
shadow->unbind(sShadow);
|
||||||
cube->unbind(sEnvironment);
|
cube->unbind(sEnvironment);
|
||||||
|
atlas->bind(sDiffuse);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glColor3f(1, 1, 1);
|
glColor3f(1, 1, 1);
|
||||||
@@ -884,12 +884,14 @@ struct Level {
|
|||||||
glTranslatef(0, 0, 256);
|
glTranslatef(0, 0, 256);
|
||||||
|
|
||||||
ambientCache->textures[j * 4 + dbg_ambient]->bind(sDiffuse);
|
ambientCache->textures[j * 4 + dbg_ambient]->bind(sDiffuse);
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glTexCoord2f(0, 0); glVertex3f(-256, 256, 0);
|
glTexCoord2f(0, 0); glVertex3f(-256, 256, 0);
|
||||||
glTexCoord2f(1, 0); glVertex3f( 256, 256, 0);
|
glTexCoord2f(1, 0); glVertex3f( 256, 256, 0);
|
||||||
glTexCoord2f(1, 1); glVertex3f( 256, -256, 0);
|
glTexCoord2f(1, 1); glVertex3f( 256, -256, 0);
|
||||||
glTexCoord2f(0, 1); glVertex3f(-256, -256, 0);
|
glTexCoord2f(0, 1); glVertex3f(-256, -256, 0);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
@@ -3,7 +3,7 @@ cls
|
|||||||
set SRC=main.cpp
|
set SRC=main.cpp
|
||||||
set PROJ=OpenLara
|
set PROJ=OpenLara
|
||||||
set FLAGS=-O3 -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -I../../
|
set FLAGS=-O3 -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -I../../
|
||||||
set PRELOAD=./LEVEL2.PSX
|
set PRELOAD=./GYM.PSX
|
||||||
echo.
|
echo.
|
||||||
call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file %PRELOAD%
|
call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file %PRELOAD%
|
||||||
gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem
|
gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem
|
@@ -102,7 +102,5 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<audio autoplay loop><source src="05.ogg" type="audio/ogg"></audio>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Reference in New Issue
Block a user