From 64865249a4d7c4dcd88a1ecf3f05f5f3d0054697 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 8 Feb 2023 10:51:04 +0100 Subject: [PATCH] Removed the baselight addition during light sampling, as that was actually the cause of weird lighting bugs in some areas. This will probably be relevant again when implementing animated lights, but not right now. --- lighting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lighting.cpp b/lighting.cpp index 54a0f1d..0ebccb8 100644 --- a/lighting.cpp +++ b/lighting.cpp @@ -154,7 +154,7 @@ unsigned char compute_faceVertex_light(const world_t* world, const face_t* face, auto point = vertex->toVec(); // Sample this face's lighting contribution - unsigned int light = sample_lightmap(world, face, faceBounds.find(face)->second, point) + (0xFF - face->baselight); + unsigned int light = sample_lightmap(world, face, faceBounds.find(face)->second, point); int numSamples = 1; // Collect edges connected to this vertex, filter out the smooth ones only @@ -210,7 +210,7 @@ unsigned char compute_faceVertex_light2(const world_t* world, const face_t* face auto point = vertex->toVec(); // Sample this face's lighting contribution - unsigned int light = sample_lightmap(world, face, faceBounds.find(face)->second, point) + (0xFF - face->baselight); + unsigned int light = sample_lightmap(world, face, faceBounds.find(face)->second, point); int numSamples = 1; const plane_t* thisPlane = &world->planes[face->plane_id]; @@ -345,7 +345,7 @@ unsigned char compute_faceVertex_light4(const world_t* world, const face_t* refF if (!sample_lightmap(world, face, faceBounds.find(face)->second, point, &sample)) continue; - light += sample + (0xFF - face->baselight); + light += sample; numSamples++; } @@ -393,7 +393,7 @@ unsigned char compute_faceVertex_light5(const world_t* world, const face_t* refF if (!sample_lightmap(world, face, faceBounds.find(face)->second, jitteredPoint, &sample)) continue; - light += sample + (0xFF - face->baselight); + light += sample; numSamples++; } }