summaryrefslogtreecommitdiff
path: root/src/gpu/effect.h
AgeCommit message (Collapse)Author
18 hoursfeat: Optional sequence end times and comprehensive effect documentationskal
This milestone implements several key enhancements to the sequencing system and developer documentation: ## Optional Sequence End Times (New Feature) - Added support for explicit sequence termination via [time] syntax - Example: SEQUENCE 0 0 [30.0] forcefully ends all effects at 30 seconds - Updated seq_compiler.cc to parse optional [time] parameter with brackets - Added end_time_ field to Sequence class (default -1.0 = no explicit end) - Modified update_active_list() to check sequence end time and deactivate all effects when reached - Fully backward compatible - existing sequences work unchanged ## Comprehensive Effect Documentation (demo.seq) - Documented all effect constructor parameters (standard: device, queue, format) - Added runtime parameter documentation (time, beat, intensity, aspect_ratio) - Created detailed effect catalog with specific behaviors: * Scene effects: HeptagonEffect, ParticlesEffect, Hybrid3DEffect, FlashCubeEffect * Post-process effects: GaussianBlurEffect, SolarizeEffect, ChromaAberrationEffect, ThemeModulationEffect, FadeEffect, FlashEffect - Added examples section showing common usage patterns - Documented exact parameter behaviors (e.g., blur pulsates 0.5x-2.5x, flash triggers at intensity > 0.7, theme cycles every 8 seconds) ## Code Quality & Verification - Audited all hardcoded 1280x720 dimensions throughout codebase - Verified all shaders use uniforms.resolution and uniforms.aspect_ratio - Confirmed Effect::resize() properly updates width_/height_ members - No issues found - dimension handling is fully dynamic and robust ## Files Changed - tools/seq_compiler.cc: Parse [end_time], generate set_end_time() calls - src/gpu/effect.h: Added end_time_, set_end_time(), get_end_time() - src/gpu/effect.cc: Check sequence end time in update_active_list() - assets/demo.seq: Comprehensive syntax and effect documentation - Generated files updated (timeline.cc, assets_data.cc, music_data.cc) This work establishes a more flexible sequencing system and provides developers with clear documentation for authoring demo timelines. handoff(Claude): Optional sequence end times implemented, effect documentation complete, dimension handling verified. Ready for next phase of development.
46 hoursrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
3 daysfix(gpu): Resolve high-DPI squished rendering and 3D shadow bugsskal
- Implemented dynamic resolution support in all shaders and effects. - Added explicit viewport setting for all render passes to ensure correct scaling. - Fixed 3D shadow mapping by adding PLANE support and standardizing soft shadow logic. - Propagated resize events through the Effect hierarchy. - Applied project-wide code formatting.
3 daysfeat(3d): Use procedural grid for floor and revert object noiseskal
- Reverted test_3d_render to use the global 'noise' texture for floating objects, restoring their bump mapping. - Implemented a procedural grid directly in the fragment shader for rasterized objects (floor). - Inverted the grid color scheme (black lines on a lighter background) as requested. - This ensures accurate object bump mapping and clear shadow visibility on the floor without requiring multiple texture bindings.
4 daysfeat(gpu/assets): Fix tests, integrate bumpy 3D renderer and procedural assetsskal
- Fixed test_sequence by restoring MainSequence::init_test for mocking. - Corrected CMakeLists.txt dependencies and source groupings to prevent duplicate symbols. - standardizing Effect constructor signature for seq_compiler compatibility. - Implemented Hybrid3DEffect using bumpy Renderer3D and procedural NOISE_TEX. - Updated MainSequence to support depth buffer for 3D elements. - Formatted all source files with clang-format.
4 daysfeat(gpu): Integrate bumpy 3D renderer into main demoskal
- Added depth buffer support to MainSequence. - Implemented Hybrid3DEffect for the main timeline. - Fixed effect initialization order in MainSequence. - Ensured depth-stencil compatibility for all scene effects. - Updated demo sequence with 3D elements and post-processing.
5 daysChore: Apply clang-format to the codebaseskal
5 daysRefactor: Move common GPU fields to base Effect classesskal
Moved WGPUDevice, WGPUQueue, and GpuBuffer uniforms_ into the base Effect and PostProcessEffect classes. Updated all derived effect classes to use these inherited members and refactored their constructors. Also fixed associated compilation errors in test files and adjusted a printf statement.
5 daysclang-formatskal
5 daysstyle: add vertical compression rules to clang-formatskal
- Enabled AllowShortFunctionsOnASingleLine: All - Enabled AllowShortBlocksOnASingleLine: Always - Enabled AllowShortIfStatementsOnASingleLine: Always - Enabled AllowShortLoopsOnASingleLine: true - Set MaxEmptyLinesToKeep: 1 - Applied formatting to all source files.
5 daysfix: Resolve all build/linking errors for Sequence/Effect testsskal
Adds missing source files and libraries for test_sequence target in CMakeLists.txt. Corrects include paths and ensures proper linking against WebGPU and GLFW libraries. All test suites now compile and pass.
5 daysfix: Cross-compilation and style complianceskal
Fixes seq_compiler build for Windows cross-compilation. Moves common WebGPU compatibility shims to gpu.h. Applies project-wide coding style via clang-format. Verified on both macOS (native) and Windows (cross-compile).
5 daysfeat: Multi-pass rendering architecture and effect stubsskal
Implements a post-processing pipeline using offscreen framebuffers. Adds stubs for MovingEllipse, ParticleSpray, GaussianBlur, Solarize, Distort, and ChromaAberration effects. Updates MainSequence to orchestrate the scene pass and post-processing chain.
5 daysfeat: Add --seek command line option for fast-forward debuggingskal
This feature allows developers to jump to a specific time in the demo sequence (e.g., './demo64k --seek 10.5'). It simulates the game logic, audio state (rendering silent buffers), and visual physics (compute shaders) from t=0 up to the target time before starting real-time playback. Audio initialization is refactored to separate device init and start.
5 daysfeat: Implement Sequence and Effect system for demo choreographyskal
Refactors the rendering pipeline into a modular Sequence/Effect system. 'MainSequence' manages the final frame rendering and a list of 'Sequence' layers. 'Sequence' manages a timeline of 'Effect' objects (start/end/priority). Concrete effects (Heptagon, Particles) are moved to 'demo_effects.cc'. Updates main loop to pass beat and aspect ratio.