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

fix shadow shader and ambient factors for pickups

This commit is contained in:
XProger
2019-05-25 06:56:40 +03:00
parent b5e54e3a39
commit 34920ccec8
2 changed files with 16 additions and 7 deletions

View File

@@ -1961,12 +1961,21 @@ struct Level : IGame {
memcpy(controller->ambient, cube.colors, sizeof(cube.colors)); // store last calculated ambient into controller
}
} else {
controller->ambient[0] =
controller->ambient[1] =
controller->ambient[2] =
controller->ambient[3] =
controller->ambient[4] =
controller->ambient[5] = vec4(Core::active.material.y);
if (entity.isPickup()) {
controller->ambient[0] =
controller->ambient[1] =
controller->ambient[5] =
controller->ambient[4] = vec4(Core::active.material.y * 0.8f);
controller->ambient[2] = vec4(Core::active.material.y * 0.1f);
controller->ambient[3] = vec4(Core::active.material.y);
} else {
controller->ambient[0] =
controller->ambient[1] =
controller->ambient[2] =
controller->ambient[3] =
controller->ambient[4] =
controller->ambient[5] = vec4(Core::active.material.y);
}
}
Core::active.shader->setParam(uAmbient, controller->ambient[0], 6);
}

View File

@@ -13,7 +13,7 @@ R"====(
#endif
#ifdef OPT_SHADOW
#define SHADOW_TEXEL vec3(1.0 / 1024.0, 1.0 / 1024.0, 0.0)
#define SHADOW_TEXEL vec3(1.0 / 2048.0, 1.0 / 2048.0, 0.0)
uniform mat4 uLightProj;
#ifdef OPT_VLIGHTPROJ