diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-08 19:09:05 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-08 19:09:05 +0100 |
| commit | cd807732799904f6731f460cc0469143c410c2c9 (patch) | |
| tree | 7eb49f0cd5eee9a9d4aabf2f9d64f053c081f70c /src/3d/renderer_pipelines.cc | |
| parent | 63c391e803318158f239c02df5f53244bfd6a074 (diff) | |
feat(gpu): Add WGSL noise and hash function library (Task #59)
Implements comprehensive RNG and noise functions for procedural
shader effects:
Hash Functions:
- hash_1f, hash_2f, hash_3f (float-based, fast)
- hash_2f_2f, hash_3f_3f (vector output)
- hash_1u, hash_1u_2f, hash_1u_3f (integer-based, high quality)
Noise Functions:
- noise_2d, noise_3d (value noise with smoothstep)
- fbm_2d, fbm_3d (fractional Brownian motion)
- gyroid (periodic minimal surface)
Integration:
- Added to ShaderComposer as "math/noise" snippet
- Available via #include "math/noise" in WGSL shaders
- Test suite validates all 11 functions compile
Testing:
- test_noise_functions.cc validates shader loading
- All 33 tests pass (100%)
Size Impact: ~200-400 bytes per function used (dead-code eliminated)
Files:
- assets/final/shaders/math/noise.wgsl (new, 4.2KB, 150 lines)
- assets/final/demo_assets.txt (added SHADER_MATH_NOISE)
- assets/final/test_assets_list.txt (added SHADER_MATH_NOISE)
- src/gpu/effects/shaders.cc (registered snippet)
- src/tests/test_noise_functions.cc (new test)
- CMakeLists.txt (added test target)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/3d/renderer_pipelines.cc')
0 files changed, 0 insertions, 0 deletions
