Fixing LOD policy

This commit is contained in:
2026-11-05 17:06:16 +01:00
parent 9bd2cd5667
commit 599a40301e
3 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -121,7 +121,7 @@ float3 floor_scale(float3 position, uint32_t scale_exp)
float node_size(uint32_t scale_exp)
{
let mantissa_mask = ~(~0u << 23);
return ((1 << scale_exp) & mantissa_mask | (127 << 23)) - 1.f;
return asfloat(((1 << scale_exp) & mantissa_mask | (127 << 23))) - 1.f;
}
ByteColor fetch_color<let N : int>(VoxelCacheParameters<N> p, uint32_t index, uint32_t child_index)
@@ -197,7 +197,7 @@ public struct VoxelCacheTracer<let N : int, H : IVoxelHit<N>> : IVoxelCache
}
// Request subdiv
if (this.report_requests && !lod.shouldStop(t + offset_t, scale_exp) && current_node.subdivided() && !current_node.pointer_valid())
if (this.report_requests && !lod.shouldStop(t + offset_t, node_size(scale_exp)) && current_node.subdivided() && !current_node.pointer_valid())
{
this.parameters.request_buffer[current_node_index].requests[child_index].add(1);
}