From 306f96164784a8cbf405e72fa4364d6523366e95 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 5 May 2025 15:09:54 +0200 Subject: old dir --- flowy/src/motion/debug.wgsl | 50 --------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 flowy/src/motion/debug.wgsl (limited to 'flowy/src/motion/debug.wgsl') diff --git a/flowy/src/motion/debug.wgsl b/flowy/src/motion/debug.wgsl deleted file mode 100644 index d2c56a4..0000000 --- a/flowy/src/motion/debug.wgsl +++ /dev/null @@ -1,50 +0,0 @@ - - -struct Params { - block_size: vec2, - offsets_stride: u32 -} - -struct BlockOffset { - score: f32, - offset: vec2, - tint: vec3, -} - -@group(0) @binding(0) var params: Params; -@group(0) @binding(1) var offsets: array; -@group(0) @binding(2) var next: texture_2d; -@group(0) @binding(3) var prev: texture_2d; -@group(0) @binding(4) var out: texture_storage_2d; - -@compute @workgroup_size(1)fn main(@builtin(global_invocation_id) global_id: vec3) { - let uv = vec2(global_id.xy) * params.block_size; - - let bl = offsets[global_id.x + global_id.y * params.offsets_stride]; - - for (var x = 0; x < params.block_size.x; x++) { - for (var y = 0; y < params.block_size.y; y++) { - let base = uv + vec2(x, y); - let col = vec4(colormap_vec(vec2(bl.offset) * 0.08),1.); - textureStore(out, base, col); - } - } - - // for (var x = 0; x < params.block_size.x; x++) { - // for (var y = 0; y < params.block_size.y; y++) { - // let base = uv + vec2(x, y); - // let col_dec = textureLoad(prev, base + bl.offset, 0) + vec4(bl.tint, 1.); - // let col_orig = textureLoad(next, base, 0); - - // let col = vec4( saturate((0.5) + (col_orig.rgb - col_dec.rgb) * 100.), 1.0); - - // textureStore(out, base, col); - // } - // } -} - - -fn colormap_vec(v: vec2) -> vec3 { - return vec3(v.y, v.x - 0.5 * v.y, -v.x - 0.5 * v.y); -} - -- cgit v1.2.3-70-g09d2