diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-21 10:24:24 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-21 10:24:24 +0100 |
| commit | 7d6c9bc2f10a479d9e054af56a75e535d1015b79 (patch) | |
| tree | a364cc4d16052162c48e15e9e05e491e9ba1e758 /workspaces/main/shaders/flash.wgsl | |
| parent | 53187e2d930cf982a0bc7f99262586c6a8a0640a (diff) | |
docs: Update WGSL files to use shorter vector and matrix type aliases
Replaced `vec2<f32>`, `vec3<f32>`, `vec4<f32>`, `mat4x4<f32>`, and `mat3x3<f32>` 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.
Diffstat (limited to 'workspaces/main/shaders/flash.wgsl')
| -rw-r--r-- | workspaces/main/shaders/flash.wgsl | 12 |
1 files changed, 6 insertions, 6 deletions
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<uniform> uniforms: UniformsSequenceParams; struct VertexOutput { - @builtin(position) position: vec4<f32>, - @location(0) uv: vec2<f32>, + @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<f32>(x * 2.0 - 1.0, 1.0 - y * 2.0, 0.0, 1.0); - out.uv = vec2<f32>(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<f32> { +@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<f32>(final_intensity, final_intensity, final_intensity, 1.0); + return vec4f(final_intensity, final_intensity, final_intensity, 1.0); } |
