diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
| commit | 472c2258dbeca000a454ea1781f09df63477563e (patch) | |
| tree | 98ac75c3824f19f4a598a807b3cb6aa13e8cb0c3 /common/shaders/postprocess_inline.wgsl | |
| parent | 1c5a9fb7b8c704a59ec58894adf46d73d1615072 (diff) | |
replace wgsl type: vec4<f32> -> vec4f ..
Diffstat (limited to 'common/shaders/postprocess_inline.wgsl')
| -rw-r--r-- | common/shaders/postprocess_inline.wgsl | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/common/shaders/postprocess_inline.wgsl b/common/shaders/postprocess_inline.wgsl index fcc5e27..84ef3d3 100644 --- a/common/shaders/postprocess_inline.wgsl +++ b/common/shaders/postprocess_inline.wgsl @@ -2,29 +2,29 @@ // Use these instead of separate effect classes for v2 sequences // Vignette: darkens edges based on distance from center -fn apply_vignette(color: vec4<f32>, uv: vec2<f32>, radius: f32, softness: f32, intensity: f32) -> vec4<f32> { - let d = distance(uv, vec2<f32>(0.5, 0.5)); +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 vec4<f32>(color.rgb * mix(1.0, vignette, intensity), color.a); + return vec4f(color.rgb * mix(1.0, vignette, intensity), color.a); } // Flash: additive white flash -fn apply_flash(color: vec4<f32>, flash_intensity: f32) -> vec4<f32> { - return color + vec4<f32>(flash_intensity, flash_intensity, flash_intensity, 0.0); +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: vec4<f32>, fade_amount: f32, fade_color: vec3<f32>) -> vec4<f32> { - return vec4<f32>(mix(color.rgb, fade_color, fade_amount), color.a); +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: vec4<f32>, theme_color: vec3<f32>, strength: f32) -> vec4<f32> { - return vec4<f32>(mix(color.rgb, color.rgb * theme_color, strength), color.a); +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: vec4<f32>, threshold: f32, strength: f32, time: f32) -> vec4<f32> { +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); @@ -44,18 +44,18 @@ fn apply_solarize(color: vec4<f32>, threshold: f32, strength: f32, time: f32) -> // Chroma aberration: RGB channel offset fn apply_chroma_aberration(input_tex: texture_2d<f32>, input_sampler: sampler, - uv: vec2<f32>, offset: f32, resolution: vec2<f32>) -> vec4<f32> { + uv: vec2f, offset: f32, resolution: vec2f) -> vec4f { let pixel_offset = offset / resolution; - let r = textureSample(input_tex, input_sampler, uv + vec2<f32>(pixel_offset.x, 0.0)).r; + 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 - vec2<f32>(pixel_offset.x, 0.0)).b; + 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 vec4<f32>(r, g, b, a); + return vec4f(r, g, b, a); } // Distort: UV distortion based on time -fn apply_distort(uv: vec2<f32>, time: f32, strength: f32) -> vec2<f32> { +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 + vec2<f32>(distort_x, distort_y); + return uv + vec2f(distort_x, distort_y); } |
