Fix a froxelization bug
we would be short by one froxel on the left, usually this wasn't a problem due to the light falloff.
This commit is contained in:
committed by
Mathias Agopian
parent
8ae8dd59b1
commit
afade93bad
@@ -856,7 +856,9 @@ void Froxelizer::froxelizePointAndSpotLight(
|
||||
// find the begin index (left side)
|
||||
for (bx = x0; bx <= xcenter; ++bx) {
|
||||
if (spherePlaneDistanceSquared(cy, planesX[bx].x, planesX[bx].z) > 0) {
|
||||
// intersection
|
||||
// intersection, if we intersect with a plane at index bx, we
|
||||
// actually intrude in the froxel to its left, i.e. with index bx - 1
|
||||
bx -= bx > 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user