mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 01:24:35 +02:00
fix lighting
This commit is contained in:
@@ -161,6 +161,7 @@ struct Controller {
|
|||||||
timer = 0.0f;
|
timer = 0.0f;
|
||||||
ambient[0] = ambient[1] = ambient[2] = ambient[3] = ambient[4] = ambient[5] = vec4(intensityf(getRoom().ambient));
|
ambient[0] = ambient[1] = ambient[2] = ambient[3] = ambient[4] = ambient[5] = vec4(intensityf(getRoom().ambient));
|
||||||
targetLight = NULL;
|
targetLight = NULL;
|
||||||
|
mainLightFlip = false;
|
||||||
updateLights(false);
|
updateLights(false);
|
||||||
visibleMask = 0xFFFFFFFF;
|
visibleMask = 0xFFFFFFFF;
|
||||||
|
|
||||||
@@ -1163,8 +1164,7 @@ struct Controller {
|
|||||||
vec4 tcolor = vec4(vec3(targetLight->color.r, targetLight->color.g, targetLight->color.b) * (1.0f / 255.0f), float(targetLight->radius));
|
vec4 tcolor = vec4(vec3(targetLight->color.r, targetLight->color.g, targetLight->color.b) * (1.0f / 255.0f), float(targetLight->radius));
|
||||||
|
|
||||||
if (mainLightFlip != level->state.flags.flipped) {
|
if (mainLightFlip != level->state.flags.flipped) {
|
||||||
if (room.alternateRoom > -1)
|
lerp = false;
|
||||||
lerp = false;
|
|
||||||
mainLightFlip = level->state.flags.flipped;
|
mainLightFlip = level->state.flags.flipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3466,7 +3466,7 @@ namespace TR {
|
|||||||
stream.seek(4); // radius2
|
stream.seek(4); // radius2
|
||||||
|
|
||||||
if ((version & VER_VERSION) < VER_TR3) {
|
if ((version & VER_VERSION) < VER_TR3) {
|
||||||
int value = 255 - clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255);
|
int value = clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255);
|
||||||
light.color.r = light.color.g = light.color.b = value;
|
light.color.r = light.color.g = light.color.b = value;
|
||||||
light.color.a = 0;
|
light.color.a = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user