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:
21
src/level.h
21
src/level.h
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user