summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
3 daysfix(3d): Tighten torus proxy hull and ensure floor grid visibilityskal
- Adjusted Torus proxy hull in vs_main to 1.5x0.5x1.5 for better SDF fit. - Updated VisualDebug::add_box to use per-object local extents. - Standardized floor grid mapping in fs_main using planar p.xz projection. - Verified non-uniform scale and rotation robustness in test_3d_render.
3 dayschore: Apply final code formatting and cleanupskal
3 daysfix(3d): Unify SDF path for all objects and stabilize shadowsskal
- Converted floor in test_3d_render to a large SDF BOX for consistent shading. - Standardized lighting (light_dir = 1,1,1) and normal calculation for all objects. - Fixed calc_shadow bias and skip_idx to reliably prevent self-shadowing. - Improved raymarching robustness in fs_main to find exact SDF hit points.
3 daysfix(3d): Restore and enhance 3D shadowsskal
- Elevated objects in test_3d_render to avoid shadow occlusion. - Slanted light direction for more visible, elongated shadows. - Sharpened shadows by increasing k constant to 32. - Cleaned up debug printfs from previous turns. - Maintained skip_idx logic for robust self-shadowing prevention.
3 daysfix(3d): Revert to working N-1 shadow configurationskal
- Reverted floor to CUBE (rasterized) at index 0. - Restored vertical lighting and original soft shadow loop (k=8, t+=h). - Maintained instance-based skip_idx for generic self-shadowing prevention. - Confirmed map_scene correctly skips the floor, allowing other objects to cast shadows on it.
3 daysfix(3d): Resolve missing shadows on floor planeskal
- Switched floor from rasterized CUBE to SDF PLANE for consistent shadow mapping. - Implemented skip_idx in map_scene to properly prevent self-shadowing. - Standardized soft shadow logic with improved bias and step size. - Increased object elevation and adjusted light direction for more visible shadows. - Enabled debug boxes in test_3d_render.
3 daysflesh out extra details in the MD filesskal
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 daysfix(shader): Correct WGSL loop syntax in calc_shadowskal
- Replaced invalid 'i++' with 'i = i + 1' in the shader's calc_shadow function loop. - This resolves the shader parsing error and allows the 3D renderer test to run successfully on all platforms.
3 daystest(3d): Add procedural grid to floor and enable texturingskal
- Modified 'test_3d_render' to generate and use a procedural 'grid' texture for the floor. - Updated fragment shader to sample the texture for rasterized objects, adding a grid pattern to the floor. - This provides visual detail and contrast, making raymarched shadows much easier to observe and verify.
3 daysfeat(3d): Implement unified shadow system with non-uniform scale supportskal
- Part 1: Unified shadow calculation in fragment shader for both SDF and rasterized objects. - Part 2: Added 'model_inverse_transpose' to ObjectData to correctly transform normals for non-uniformly scaled objects. - Part 3: Brightened the floor in 'test_3d_render' to make shadows visible. - Verified correct lighting and shadows on the non-uniformly scaled floor.
3 daysfix(3d): Correct shadow bug with non-uniform scaleskal
- Changed the floor object in 'test_3d_render' from SDF BOX to rasterized CUBE. - This prevents the non-uniform scale of the floor from breaking the scene-wide SDF query used for shadow calculations. - The lighting and shadows now render correctly in the more complex test scene.
3 daystest(3d): Enhance test scene with more objectsskal
- Updated 'src/tests/test_3d_render.cc' to populate the scene with a large floor and 30 randomly placed objects (spheres, boxes, tori). - This provides a more complex environment to verify the new shadow mapping implementation.
3 daysfeat(3d): Add scaffolding for visual debugging (Task #18a)skal
- Added 'src/3d/visual_debug.h/cc' to implement wireframe rendering. - Integrated VisualDebug into Renderer3D with a static global toggle. - Added '--debug' command-line option to 'demo64k' and 'test_3d_render' to enable wireframes. - Updated 'src/gpu/effects/hybrid_3d_effect.h' to expose the debug setter (reverted later as static method used). - Ensured full cross-platform compatibility (native and Windows) for the new debug module. - All code guarded by STRIP_ALL for final release.
3 daysfix(build): Add compatibility for older wgpu-native headersskal
- Added preprocessor definitions for 'WGPUOptionalBool_True' and 'WGPUOptionalBool_False' to ensure successful cross-compilation against the older wgpu-native headers used for the Windows build. - This resolves the build failures in the Windows CI/check script.
3 daysrefactor(build): Centralize generated files and clean up project layoutskal
- Task A: Centralized all generated code (assets, timeline) into a single directory to create a single source of truth. - Task A: Isolated test asset generation into a temporary build directory, preventing pollution of the main source tree. - Task B: Vertically compacted all C/C++ source files by removing superfluous newlines. - Task C: Created a top-level README.md with project overview and file descriptions. - Task D: Moved non-essential documentation into a directory to reduce root-level clutter.
3 daysrefactor(platform): Encapsulate state in PlatformState structskal
- Replaced all global static variables in the platform layer with a single PlatformState struct. - Updated all platform function signatures to accept a pointer to this struct, making the implementation stateless and more modular. - Refactored main.cc, tests, and tools to instantiate and pass the PlatformState struct. - This improves code organization and removes scattered global state.
3 daysfeat(platform): Fix high-DPI scaling and add resolution optionskal
- Fixed a 'squished' viewport bug on high-DPI (Retina) displays by querying the framebuffer size in pixels instead of using the window size in points. - Centralized window dimension management within the platform layer. - Added a '--resolution WxH' command-line option to allow specifying a custom window size at startup. This option is stripped in STRIP_ALL builds. - Updated all test and tool executables to use the new platform API.
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 daystry to fix the messskal
4 daysfeat(assets): Implement procedural asset generation pipelineskal
- Updated asset_packer to parse PROC(...) syntax. - Implemented runtime dispatch in AssetManager for procedural generation. - Added procedural generator functions (noise, grid, periodic). - Added comprehensive tests for procedural asset lifecycle.
4 daysfeat(asset_manager): Implement array-based cachingskal
- Refactored asset manager to use a static array for caching, improving performance and memory efficiency. - Updated asset_packer to correctly generate ASSET_LAST_ID for array sizing. - Modified asset_manager.h to use a forward declaration for AssetId. - Updated asset_manager.cc to use the conditional include for generated asset headers. - Added a test case in test_assets to verify the array-based cache and ASSET_LAST_ID logic.
4 daysfeat: Add seamless bump mapping with procedural noiseskal
- Replaced white noise with smooth value-like noise. - Implemented periodic texture generation (seam blending). - Integrated bump mapping into Renderer3D using finite difference of displaced SDF. - Updated test_3d_render with noise texture and multiple SDF shapes (Box, Sphere, Torus).
4 daysfeat: Implement hybrid rendering with SDF primitivesskal
- Added SDF logic for Sphere, Box, and Torus in WGSL. - Implemented hybrid normal calculation (analytical for sphere, numerical fallback). - Updated Renderer3D to dispatch object types to shader. - Updated test_3d_render to display mixed SDF shapes (Sphere, Torus, Box). - Added BOX to ObjectType enum.
4 daysfeat: Implement 3D system and procedural texture managerskal
- Extended mini_math.h with mat4 multiplication and affine transforms. - Implemented TextureManager for runtime procedural texture generation and GPU upload. - Added 3D system components: Camera, Object, Scene, and Renderer3D. - Created test_3d_render mini-demo for interactive 3D verification. - Fixed WebGPU validation errors regarding depthSlice and unimplemented WaitAny.
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 daysrefactor: move generated asset files to src/generated/skal
- Updated CMakeLists.txt to generate assets.h and assets_data.cc in src/generated/. - Updated scripts/gen_assets.sh to reflect the new output location. - Modified asset_packer.cc to generate correct include paths in assets_data.cc. - Updated source files (main.cc, asset_manager.cc, test_assets.cc) to include headers from the 'generated/' subdirectory. - Ensured all targets have correct include paths to find generated headers. - Removed stale generated files from src/.
5 daysfix(gpu): resolve multiple WebGPU validation and runtime errorsskal
- Fixed 'Invalid sample count 0' and 'Invalid anisotropic clamp: 0' by ensuring explicit pipeline and sampler states. - Resolved WGSL parsing errors by replacing swizzle assignments in compute shaders. - Fixed 'Texture destroyed' error in render_frame by reordering command submission and resource presentation/release. - Added WGPU_DEPTH_SLICE_UNDEFINED for Windows compatibility and ensured consistent resolveTarget initialization. - Cleaned up PassthroughEffect bind group layout mismatch and redundant string helper definitions. - Verified all tests pass and applied consistent formatting.
5 daystest: Finalize sequence/effect system testsskal
Refines tests for the sequence and effect system to focus on logic (init, start, end calls) rather than GPU output, as full GPU mocking is complex. Updates HOWTO.md to reflect this.
6 daysChore: Add missing newlines at end of source filesskal
6 daysenforce code styleskal
6 daysadd mini_math.h header-only vector libskal
8 daysfeat(assets): Separate demo and test asset listsskal
Renamed demo assets to 'demo_assets.txt' and created 'test_assets_list.txt' for AssetManagerTest to prevent interference. - Updated CMakeLists.txt to generate separate headers for demo and test. - Updated test_assets.cc to conditionally include the test-specific header. - Incorporated gen_assets.sh into the 'final' target.
8 daysstyle: Add 3-line descriptive headers to all source filesskal
This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process.
8 daystest(assets): Add functional tests for asset management systemskal
This commit makes the asset packer fully functional and adds an end-to-end test suite. - Updated asset_packer.cc to read file contents and embed them as hex arrays. - Added actual asset files (null.bin, test_asset.txt) for testing. - Implemented src/tests/test_assets.cc to verify data integrity at runtime. - Refactored CMakeLists.txt to handle generated file dependencies correctly.
9 daysfeat: Implement spectool & specview; refactor coding style; update docsskal
This commit introduces new tools for spectrogram manipulation and visualization, establishes a consistent coding style, and updates project documentation. Key changes include: - **Spectrogram Tools: - : A command-line utility for analyzing WAV/MP3 files into custom spectrogram format and playing back these spectrograms via the synth engine. - : A command-line tool for visualizing spectrogram files as ASCII art in the console. - **Coding Style Enforcement: - Added a configuration file enforcing LLVM-based style with 2-space indentation, no tabs, and an 80-column line limit. - Renamed all C++ source files from to for project consistency. - Applied automatic formatting using exit across the entire codebase. - **Documentation & Workflow: - Created to define a commit policy requiring tests to pass before committing. - Updated with instructions for building and using and , and referenced . - Updated and to reflect the new tools, audio architecture decisions (real-time additive synthesis, double-buffering for dynamic updates, WAV/MP3 support), coding style, and development workflow. - **Build System: - Modified to: - Include new targets for and under the option. - Update source file extensions to . - Add a new end-to-end test for to the suite.
9 daystest(spectool): Add end-to-end test for analysis toolskal
Adds a new CTest unit test that performs a full, end-to-end verification of the 'spectool analyze' command. The test programmatically generates a sine wave, saves it as a .wav file, executes the spectool executable as a subprocess to analyze the wave, and then verifies the integrity of the resulting .spec file. This ensures the analysis pipeline (WAV decoding, windowing, FDCT, and file I/O) works correctly.
9 daysfeat(audio): Implement real-time spectrogram synthesizerskal
Adds a multi-voice, real-time audio synthesis engine that generates sound from spectrogram data using an Inverse Discrete Cosine Transform (IDCT). Key features: - A thread-safe, double-buffered system for dynamically updating spectrograms in real-time without interrupting audio playback. - Core DSP components: FDCT, IDCT, and Hamming window functions. - A simple sequencer in the main loop to demonstrate scripted audio events and dynamic updates. - Unit tests for the new synth engine and Hamming window, integrated with CTest. - A file documenting the build process, features, and how to run tests.