From 7d6c9bc2f10a479d9e054af56a75e535d1015b79 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 21 Feb 2026 10:24:24 +0100 Subject: docs: Update WGSL files to use shorter vector and matrix type aliases Replaced `vec2`, `vec3`, `vec4`, `mat4x4`, and `mat3x3` with their shorter aliases `vec2f`, `vec3f`, `vec4f`, `mat4x4f`, and `mat3x3f` across all WGSL shader files in `workspaces/main/shaders/`. This improves readability and aligns with modern WGSL conventions. --- workspaces/main/shaders/flash.wgsl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'workspaces/main/shaders/flash.wgsl') diff --git a/workspaces/main/shaders/flash.wgsl b/workspaces/main/shaders/flash.wgsl index 8f8c64c..379086e 100644 --- a/workspaces/main/shaders/flash.wgsl +++ b/workspaces/main/shaders/flash.wgsl @@ -5,23 +5,23 @@ @group(0) @binding(2) var uniforms: UniformsSequenceParams; struct VertexOutput { - @builtin(position) position: vec4, - @location(0) uv: vec2, + @builtin(position) position: vec4f, + @location(0) uv: vec2f, }; @vertex fn vs_main(@builtin(vertex_index) vid: u32) -> VertexOutput { var out: VertexOutput; let x = f32((vid & 1u) << 1u); let y = f32((vid & 2u)); - out.position = vec4(x * 2.0 - 1.0, 1.0 - y * 2.0, 0.0, 1.0); - out.uv = vec2(x, y); + out.position = vec4f(x * 2.0 - 1.0, 1.0 - y * 2.0, 0.0, 1.0); + out.uv = vec2f(x, y); return out; } -@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { +@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4f { // Strong flash on beat, fades quickly let intensity = pow(1.0 - uniforms.beat_phase, 4.0); // Add audio intensity for extra punch let final_intensity = intensity * (1.0 + uniforms.audio_intensity * 0.5); - return vec4(final_intensity, final_intensity, final_intensity, 1.0); + return vec4f(final_intensity, final_intensity, final_intensity, 1.0); } -- cgit v1.2.3