summaryrefslogtreecommitdiff
path: root/src/tests/test_3d_render.cc
AgeCommit message (Collapse)Author
3 daystest(3d): Enlarge objects and pack them closer to the centerskal
- Increased number of random objects to 30. - Enlarged base scale of all objects. - Restricted object distribution radius to encourage inter-object shadows. - Scaled up center torus and moving sphere.
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(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: 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.