|
|
@ -399,7 +399,12 @@ unsigned char compute_faceVertex_light5(const world_t* world, const face_t* refF |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!numSamples) |
|
|
if (!numSamples) |
|
|
return 0; // Shouldn't happen
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
// This really shouldn't happen. At the very least we should get a sample from the reference face, which this point originates from.
|
|
|
|
|
|
// The most common cause of issues here are floating point rounding errors in world->facesWithPoint
|
|
|
|
|
|
printf("Couldn't get any light samples for point (%.2f, %.2f, %.2f)! This is definitely a bug and should be looked at!\n", point.x, point.y, point.z); |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// We should always end up with at least one sample (that from refFace itself), so if we divide by zero here something is very much wrong
|
|
|
// We should always end up with at least one sample (that from refFace itself), so if we divide by zero here something is very much wrong
|
|
|
return (unsigned char)(light / numSamples); |
|
|
return (unsigned char)(light / numSamples); |
|
|
|