diff --git a/shaders/out/voxel.spv b/shaders/out/voxel.spv index a0ee316..9fa7cd2 100644 Binary files a/shaders/out/voxel.spv and b/shaders/out/voxel.spv differ diff --git a/shaders/voxel.slang b/shaders/voxel.slang index 017a160..c5f16e9 100644 --- a/shaders/voxel.slang +++ b/shaders/voxel.slang @@ -145,7 +145,7 @@ void ray_march_compute(uint32_t3 location: SV_DispatchThreadID, uint32_t3 local_ r.direction = ray_direction; r.invDirection = 1.f / ray_direction; - PixelFootprintLod lod = PixelFootprintLod.create((100.f * 3.14f) / 180.f, 1080.f, 200.f); + PixelFootprintLod lod = PixelFootprintLod.create((100.f * 3.14f) / 180.f, 1080.f, 2.f); Tracer>, PixelFootprintLod> tracer; tracer.structure = table_tracer; diff --git a/shaders/voxel_cache.slang b/shaders/voxel_cache.slang index b75562e..2bf786d 100644 --- a/shaders/voxel_cache.slang +++ b/shaders/voxel_cache.slang @@ -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(VoxelCacheParameters p, uint32_t index, uint32_t child_index) @@ -197,7 +197,7 @@ public struct VoxelCacheTracer> : 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); }