From 7bef1dad7e16e50d9153c40d22b67de152f057f4 Mon Sep 17 00:00:00 2001 From: Molive Date: Tue, 27 Oct 2026 23:52:19 +0000 Subject: [PATCH] mess with seb's trace --- crates/bevy_tape_load/src/render/trace.wesl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/bevy_tape_load/src/render/trace.wesl b/crates/bevy_tape_load/src/render/trace.wesl index e83bb8b..49f0eb4 100644 --- a/crates/bevy_tape_load/src/render/trace.wesl +++ b/crates/bevy_tape_load/src/render/trace.wesl @@ -5,9 +5,13 @@ import package::render::util::{get_internal_pos, get_low_corner, get_high_corner enable wgpu_binding_array; const EPSILON = .001; - const MAX_STEPS = 50; +// const SEB_EPSILON = 0.00025; +// const SEB_MAX_STEPS = 1024; +const SEB_EPSILON = EPSILON; +const SEB_MAX_STEPS = MAX_STEPS; + // axis aligned, center at the origin, dimensions "box_size" // https://iquilezles.org/articles/intersectors/ fn box_intersection(ro: vec3, rd: vec3, box_size: vec3) -> vec2 @@ -49,17 +53,17 @@ fn sebastian_trace(metadata: TapeMetadata, spatial_texture: u32, near_plane: f32 //s = s * 2.0 - 1.0; var d = s; - if (s > 0.00025) + if (s > SEB_EPSILON) { - for (var i=0; i<1024; i++) { - let uvw = ray_pos + ray_dir * d; + for (var i=0; i far_plane) { return -1.0; } let s = spatial_scene(metadata, spatial_texture, vec4(uvw, metadata.time)); //s = s * 2.0 - 1.0; d += s; - if (s < 0.00025) { + if (s < SEB_EPSILON) { return d; } } @@ -86,6 +90,6 @@ fn trace_tape(metadata: TapeMetadata, spatial_texture: u32, primitive_id: u32, r return near_far.x; } - return molive_trace(metadata, spatial_texture, near_far.x, near_far.y, raypos, raydir); + //return molive_trace(metadata, spatial_texture, near_far.x, near_far.y, raypos, raydir); return sebastian_trace(metadata, spatial_texture, near_far.x, near_far.y, raypos, raydir); }