-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
- When mapping float coordinates to quantized voxel coordinates, the coordinate should be clamped to [0, gridSize - 1]
- Code below occasionally maps coordinates to exactly
gridSize
if a sample is roughly equal to the bounding box maximum. - Occurs in first-come and random sampling strategies
CudaLOD/modules/simlod/sampling_cuda_nonprogressive/voxelize_sampleselect_first_blockwise.cu
Lines 328 to 330 in cfaa4dc
int ix = float(bitgrid_size) * (point.x - child->min.x) / childSize.x; | |
int iy = float(bitgrid_size) * (point.y - child->min.y) / childSize.y; | |
int iz = float(bitgrid_size) * (point.z - child->min.z) / childSize.z; |
Should be clamped like this:
int ix = clamp(fGridSize * (point.x - node->min.x) / boxSize.x, 0.0f, fGridSize - 1.0f);
int iy = clamp(fGridSize * (point.y - node->min.y) / boxSize.y, 0.0f, fGridSize - 1.0f);
int iz = clamp(fGridSize * (point.z - node->min.z) / boxSize.z, 0.0f, fGridSize - 1.0f);
Should probably also be done in similar sections in average and weighted strategies? e.g.
CudaLOD/modules/simlod/sampling_cuda_nonprogressive/voxelize_neighborhood_blockwise.cu
Lines 175 to 177 in cfaa4dc
float fx = fGridSize * (point.x - node->min.x) / boxSize.x; | |
float fy = fGridSize * (point.y - node->min.y) / boxSize.y; | |
float fz = fGridSize * (point.z - node->min.z) / boxSize.z; |
Metadata
Metadata
Assignees
Labels
No labels