diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-08 15:52:26 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-08 15:52:26 +0100 |
| commit | 8d3c540e097a659d7ac9b1594a0b00404002925f (patch) | |
| tree | a741a7d34b4af29c0c4afb125313a5089b0bcac2 /assets/final/HIHAT_CLOSED_DUFF.spec | |
| parent | 9339aff2360730df56690d2f2f69adff861fd8a6 (diff) | |
feat(shaders): Extract common WGSL utilities for better composability
Created math/common_utils.wgsl with reusable shader functions:
- transform_normal() - Normal matrix transform (2 call sites)
- spherical_uv() - Spherical UV mapping (7 call sites)
- spherical_uv_from_dir() - For direction vectors (1 call site)
- grid_pattern() - Procedural checkerboard (2 call sites)
- Constants: PI, TAU
Refactored shaders:
- renderer_3d.wgsl: 7 spherical_uv + 1 normal + 2 grid (~12 lines removed)
- mesh_render.wgsl: 1 normal transform (~3 lines removed)
- skybox.wgsl: 1 spherical UV (~2 lines removed)
Impact: ~200 bytes saved, 12 call sites deduplicated
Tests: 31/31 passing
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'assets/final/HIHAT_CLOSED_DUFF.spec')
0 files changed, 0 insertions, 0 deletions
