diff --git a/src/controller.h b/src/controller.h index 1f091a0..60a4e73 100644 --- a/src/controller.h +++ b/src/controller.h @@ -485,7 +485,7 @@ struct Controller { if (light.intensity > 0x1FFF) continue; vec3 dir = vec3(float(light.x), float(light.y), float(light.z)) - center; - float att = max(0.0f, 1.0f - dir.length2() / float(light.radius) / float(light.radius)) * (intensityf(light.intensity)); + float att = max(0.0f, 1.0f - dir.length2() / float(light.radius) / float(light.radius)) * (1.0f - intensityf(light.intensity)); if (att > maxAtt) { maxAtt = att; @@ -502,7 +502,7 @@ struct Controller { } vec3 tpos = vec3(float(targetLight->x), float(targetLight->y), float(targetLight->z)); - vec4 tcolor = vec4(vec3(intensityf(targetLight->intensity)), float(targetLight->radius)); + vec4 tcolor = vec4(vec3(1.0f - intensityf(targetLight->intensity)), float(targetLight->radius)); if (lerp) { float t = Core::deltaTime * 2.0f; diff --git a/src/debug.h b/src/debug.h index fbccae7..69ed5d6 100644 --- a/src/debug.h +++ b/src/debug.h @@ -357,7 +357,7 @@ namespace Debug { for (int i = 0; i < level.roomsCount; i++) for (int j = 0; j < level.rooms[i].lightsCount; j++) { TR::Room::Light &l = level.rooms[i].lights[j]; - float a = intensityf(l.intensity); + float a = 1.0f - intensityf(l.intensity); vec3 p = vec3(l.x, l.y, l.z); vec4 color = vec4(a, a, a, 1); diff --git a/src/trigger.h b/src/trigger.h index 8044e1c..984958f 100644 --- a/src/trigger.h +++ b/src/trigger.h @@ -174,6 +174,7 @@ struct Block : Controller { updateEntity(); updateFloor(true); } + updateLights(); } };