| Age | Commit message (Collapse) | Author |
|
Complete Phase 2 implementation:
- gen_perlin.wgsl: FBM with configurable octaves, amplitude decay
- gen_grid.wgsl: Grid pattern with configurable spacing/thickness
- TextureManager extensions: create_gpu_perlin_texture(), create_gpu_grid_texture()
- Asset packer now validates gen_noise, gen_perlin, gen_grid for PROC_GPU()
- 3 compute pipelines (lazy-init on first use)
Shader parameters:
- gen_perlin: seed, frequency, amplitude, amplitude_decay, octaves (32 bytes)
- gen_grid: width, height, grid_size, thickness (16 bytes)
test_3d_render migration:
- Replaced CPU sky texture (gen_perlin) with GPU version
- Replaced CPU noise texture (gen_noise) with GPU version
- Added new GPU grid texture (256x256, 32px grid, 2px lines)
Size impact:
- gen_perlin.wgsl: ~200 bytes (compressed)
- gen_grid.wgsl: ~100 bytes (compressed)
- Total Phase 2 code: ~300 bytes
- Cumulative (Phase 1+2): ~600 bytes
Testing:
- All 34 tests passing (100%)
- test_gpu_procedural validates all generators
- test_3d_render uses 3 GPU textures (noise, perlin, grid)
Next: Phase 3 - Variable dimensions, async generation, pipeline caching
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Phase 1 implementation complete:
- GPU compute shader for noise generation (gen_noise.wgsl)
- TextureManager extensions: create_gpu_noise_texture(), dispatch_noise_compute()
- Asset packer PROC_GPU() syntax support with validation
- ShaderComposer integration for #include resolution
- Zero CPU memory overhead (GPU-only textures)
- Init-time and on-demand generation modes
Technical details:
- 8×8 workgroup size for 256×256 textures
- UniformBuffer for params (width, height, seed, frequency)
- Storage texture binding (rgba8unorm, write-only)
- Lazy pipeline compilation on first use
- ~300 bytes code (Phase 1)
Testing:
- New test: test_gpu_procedural.cc (passes)
- All 34 tests passing (100%)
Future phases:
- Phase 2: Add gen_perlin, gen_grid compute shaders
- Phase 3: Variable dimensions, async generation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Implemented VignetteEffect, including its shader, parameters, and sequence integration.
- Added VignetteEffect to demo_effects.h, shaders.cc/h, and asset definitions.
- Updated seq_compiler to handle VignetteEffect parameters.
- Added VignetteEffect to test suite and updated expected counts.
- Ensured all changes build and tests pass.
- Added vignette_effect.cc implementation file.
- Updated CMakeLists.txt to include the new effect file.
- Updated assets/demo.seq to include the VignetteEffect.
- Updated assets/final/demo_assets.txt with the new shader asset.
|
|
Fixes crashes in demo64k and test_3d_render caused by uninitialized ShaderComposer. Moves InitShaderComposer() call before effect initialization in gpu.cc and adds explicit call in test_3d_render.cc. Also fixes include paths for generated assets.h in multiple files.
|
|
Split src/gpu/demo_effects.cc into individual .cc files for each effect
and created separate files for post-processing helpers and WGSL shaders.
Updated src/gpu/demo_effects.h to be a central header for all effect-related
declarations and adjusted CMakeLists.txt accordingly.
|