diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-02 17:34:03 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-02 17:34:03 +0100 |
| commit | 4eb0a67ad12fdd8c82d7cbc37991b6977cb86568 (patch) | |
| tree | 711906bed69332a599c172fae16a81c73b2b9925 /src/3d | |
| parent | 1971b20ebca35bc8dbe24902dd5749413b43ff1b (diff) | |
fix(3d): Distinguish floor grid from object textures
- Switched floor back to PLANE type in test_3d_render.
- Updated fragment shader to apply grid pattern ONLY to PLANE objects.
- Restored noise-based bump mapping and texturing for BOX and other SDF primitives.
- Verified correct visual appearance of floating cubes (no fixed grid).
Diffstat (limited to 'src/3d')
| -rw-r--r-- | src/3d/renderer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/3d/renderer.cc b/src/3d/renderer.cc index 8676db4..d39aac0 100644 --- a/src/3d/renderer.cc +++ b/src/3d/renderer.cc @@ -254,7 +254,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> { normal = normalize(transpose(normal_matrix) * n_local); // Apply texture to SDF color - if (obj_type == 2.0) { // BOX (used for floor) + if (obj_type == 4.0) { // PLANE (used for floor) let uv_grid = p.xz * 0.5; let grid = 0.5 + 0.5 * sin(uv_grid.x * 3.14) * sin(uv_grid.y * 3.14); let grid_val = smoothstep(0.45, 0.55, grid); |
