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/ellipse.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/ellipse.wgsl')
| -rw-r--r-- | workspaces/main/shaders/ellipse.wgsl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/workspaces/main/shaders/ellipse.wgsl b/workspaces/main/shaders/ellipse.wgsl index 0aaa4ae..a377507 100644 --- a/workspaces/main/shaders/ellipse.wgsl +++ b/workspaces/main/shaders/ellipse.wgsl @@ -4,9 +4,9 @@ @group(0) @binding(0) var<uniform> uniforms: CommonUniforms; -@fragment fn fs_main(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> { +@fragment fn fs_main(@builtin(position) p: vec4f) -> @location(0) vec4f { let uv = (p.xy / uniforms.resolution - 0.5) * 2.0; - let movement = vec2<f32>(sin(uniforms.time * 0.7), cos(uniforms.time * 0.5)); - let d = sdEllipse((uv * vec2<f32>(uniforms.aspect_ratio, 1.0)) - movement, vec2<f32>(0.5, 0.3) * (1.0 + uniforms.beat_phase * 0.2)); - return mix(vec4<f32>(0.2, 0.8, 0.4, 1.0), vec4<f32>(0.0), smoothstep(0.0, 0.01, d)); + let movement = vec2f(sin(uniforms.time * 0.7), cos(uniforms.time * 0.5)); + let d = sdEllipse((uv * vec2f(uniforms.aspect_ratio, 1.0)) - movement, vec2f(0.5, 0.3) * (1.0 + uniforms.beat_phase * 0.2)); + return mix(vec4f(0.2, 0.8, 0.4, 1.0), vec4f(0.0), smoothstep(0.0, 0.01, d)); } |
