diff options
| -rw-r--r-- | PROJECT_CONTEXT.md | 1 | ||||
| -rwxr-xr-x | scripts/build_win.sh | 2 | ||||
| -rw-r--r-- | src/3d/renderer.cc | 2 | ||||
| -rw-r--r-- | src/tests/test_3d_render.cc | 14 |
4 files changed, 10 insertions, 9 deletions
diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md index 538d00e..0222963 100644 --- a/PROJECT_CONTEXT.md +++ b/PROJECT_CONTEXT.md @@ -39,6 +39,7 @@ Style: - [ ] **Visual Debug Mode**: Implement a debug overlay (removable with `STRIP_ALL`) to render wireframe bounding volumes, object trajectories, and light source representations. - [ ] **Blender Exporter**: Create a tool to convert simple Blender scenes into the demo's internal asset format. - [ ] **GPU BVH & Shadows**: Implement a GPU-based Bounding Volume Hierarchy (BVH) to optimize scene queries (shadows, AO) from the shader, replacing the current O(N) loop. + - [ ] **Texture and binding groups**: currently we can only bind one texture. Support arbitrary number of textures / binding in a sane way. Avoid immediate 'hacks' and 'fixes' - **Phase 2: Advanced Size Optimization** - [x] PC+Windows (.exe binary) via MinGW - [ ] Task #4a: Linux Cross-Compilation diff --git a/scripts/build_win.sh b/scripts/build_win.sh index d61f308..6c370a8 100755 --- a/scripts/build_win.sh +++ b/scripts/build_win.sh @@ -17,7 +17,7 @@ cmake -S . -B build_win \ -DASSET_PACKER_PATH=$ASSET_PACKER_PATH \ -DSEQ_COMPILER_PATH=$SEQ_COMPILER_PATH -cmake --build build_win +cmake --build build_win -j8 # 3. Copy runtime DLLs to build_win so we can run it cp third_party/windows/lib/wgpu_native.dll build_win/ diff --git a/src/3d/renderer.cc b/src/3d/renderer.cc index 14c05f7..13917b1 100644 --- a/src/3d/renderer.cc +++ b/src/3d/renderer.cc @@ -122,7 +122,7 @@ fn map_scene(p: vec3<f32>) -> f32 { fn calc_shadow(ro: vec3<f32>, rd: vec3<f32>, tmin: f32, tmax: f32) -> f32 { var t = tmin; var res = 1.0; - for (var i = 0; i < 30; i++) { + for (var i = 0; i < 30; i = i + 1) { let h = map_scene(ro + rd * t); if (h < 0.001) { return 0.0; // Hard shadow hit diff --git a/src/tests/test_3d_render.cc b/src/tests/test_3d_render.cc index 71cc862..fbf5fc0 100644 --- a/src/tests/test_3d_render.cc +++ b/src/tests/test_3d_render.cc @@ -206,14 +206,14 @@ int main(int argc, char** argv) { g_renderer.resize(platform_state.width, platform_state.height); g_textures.init(g_device, g_queue); - ProceduralTextureDef grid_def; - grid_def.width = 256; - grid_def.height = 256; - grid_def.gen_func = procedural::gen_grid; - grid_def.params = {10.0f, 1.0f}; // Frequency, thickness - g_textures.create_procedural_texture("floor_grid", grid_def); + ProceduralTextureDef noise_def; + noise_def.width = 256; + noise_def.height = 256; + noise_def.gen_func = gen_periodic_noise; + noise_def.params = {1234.0f, 16.0f}; + g_textures.create_procedural_texture("noise", noise_def); - g_renderer.set_noise_texture(g_textures.get_texture_view("floor_grid")); + g_renderer.set_noise_texture(g_textures.get_texture_view("noise")); setup_scene(); |
