From 9ee410594a52cbc699b13de2bde4860d70c959a3 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 28 Feb 2026 09:08:57 +0100 Subject: refactor: move common/shaders/ to src/shaders/ Relocates shared WGSL shaders under src/ where all source code lives, eliminating the top-level common/ directory. - Update asset references in workspaces/main/assets.txt and workspaces/test/assets.txt - Update docs: PROJECT_CONTEXT.md, ARCHITECTURE.md, WORKSPACE_SYSTEM.md, SHADER_REUSE_INVESTIGATION.md Co-Authored-By: Claude Sonnet 4.6 --- common/shaders/postprocess_inline.wgsl | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 common/shaders/postprocess_inline.wgsl (limited to 'common/shaders/postprocess_inline.wgsl') diff --git a/common/shaders/postprocess_inline.wgsl b/common/shaders/postprocess_inline.wgsl deleted file mode 100644 index 84ef3d3..0000000 --- a/common/shaders/postprocess_inline.wgsl +++ /dev/null @@ -1,61 +0,0 @@ -// Inline post-process functions for simple effects -// Use these instead of separate effect classes for v2 sequences - -// Vignette: darkens edges based on distance from center -fn apply_vignette(color: vec4f, uv: vec2f, radius: f32, softness: f32, intensity: f32) -> vec4f { - let d = distance(uv, vec2f(0.5, 0.5)); - let vignette = smoothstep(radius, radius - softness, d); - return vec4f(color.rgb * mix(1.0, vignette, intensity), color.a); -} - -// Flash: additive white flash -fn apply_flash(color: vec4f, flash_intensity: f32) -> vec4f { - return color + vec4f(flash_intensity, flash_intensity, flash_intensity, 0.0); -} - -// Fade: linear interpolation to target color -fn apply_fade(color: vec4f, fade_amount: f32, fade_color: vec3f) -> vec4f { - return vec4f(mix(color.rgb, fade_color, fade_amount), color.a); -} - -// Theme modulation: multiply by color tint -fn apply_theme(color: vec4f, theme_color: vec3f, strength: f32) -> vec4f { - return vec4f(mix(color.rgb, color.rgb * theme_color, strength), color.a); -} - -// Solarize: threshold-based color inversion -fn apply_solarize(color: vec4f, threshold: f32, strength: f32, time: f32) -> vec4f { - let pattern_num = u32(time / 2.0); - let is_even = (pattern_num % 2u) == 0u; - let thr = threshold + 0.15 * sin(time); - var col = color; - - if (is_even) { - if (col.r < thr) { col.r = mix(col.r, 1.0 - col.r, strength); } - if (col.g < thr) { col.g = mix(col.g, 1.0 - col.g * 0.7, strength * 0.7); } - if (col.b < thr) { col.b = mix(col.b, col.b * 0.5, strength); } - } else { - if (col.r < thr) { col.r = mix(col.r, col.r * 0.6, strength); } - if (col.g < thr) { col.g = mix(col.g, 1.0 - col.g * 0.8, strength * 0.8); } - if (col.b < thr) { col.b = mix(col.b, 1.0 - col.b, strength); } - } - return col; -} - -// Chroma aberration: RGB channel offset -fn apply_chroma_aberration(input_tex: texture_2d, input_sampler: sampler, - uv: vec2f, offset: f32, resolution: vec2f) -> vec4f { - let pixel_offset = offset / resolution; - let r = textureSample(input_tex, input_sampler, uv + vec2f(pixel_offset.x, 0.0)).r; - let g = textureSample(input_tex, input_sampler, uv).g; - let b = textureSample(input_tex, input_sampler, uv - vec2f(pixel_offset.x, 0.0)).b; - let a = textureSample(input_tex, input_sampler, uv).a; - return vec4f(r, g, b, a); -} - -// Distort: UV distortion based on time -fn apply_distort(uv: vec2f, time: f32, strength: f32) -> vec2f { - let distort_x = sin(uv.y * 10.0 + time * 2.0) * strength; - let distort_y = cos(uv.x * 10.0 + time * 2.0) * strength; - return uv + vec2f(distort_x, distort_y); -} -- cgit v1.2.3