Browse Source

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.
master
Nico de Poel 3 years ago
parent
commit
64865249a4
  1. 8
      lighting.cpp

8
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++;
}
}

Loading…
Cancel
Save