summaryrefslogtreecommitdiff
path: root/src/tests/test_mesh.cc
AgeCommit message (Collapse)Author
8 hoursfix: Correct mesh normal transformation and floor shadow renderingskal
9 hoursfix(test_mesh): Resolve all WGPU API and build issues on macOSskal
- Rewrote WGPU asynchronous initialization in test_mesh.cc to align with current wgpu-native API on macOS, including correct callback signatures and userdata handling. - Replaced std::this_thread::sleep_for with platform_wgpu_wait_any for proper WGPU event processing. - Corrected static method call for Renderer3D::SetDebugEnabled. - Updated WGPUSurfaceGetCurrentTextureStatus_Success to WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal. - Removed fprintf calls from WGPU callbacks to avoid WGPUStringView::s member access issues. - Ensured a clean build and successful execution of test_mesh on macOS.
9 hoursfeat(tests): Add test_mesh tool for OBJ loading and normal visualizationskal
Implemented a new standalone test tool 'test_mesh' to: - Load a .obj file specified via command line. - Display the mesh with rotation and basic lighting on a tiled floor. - Provide a '--debug' option to visualize vertex normals as cyan lines. - Updated asset_packer to auto-generate smooth normals for OBJs if missing. - Fixed various WGPU API usage inconsistencies and build issues on macOS. - Exposed Renderer3D::GetVisualDebug() for test access. - Added custom Vec3 struct and math utilities for OBJ parsing. This tool helps verify mesh ingestion and normal computation independently of the main demo logic.