From f80e37bd61e447f1d66fbb5eb4c1ab7a8a77cf0f Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 11:31:00 +0100 Subject: feat: Add seamless bump mapping with procedural noise - 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). --- src/tests/test_3d.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/tests/test_3d.cc') diff --git a/src/tests/test_3d.cc b/src/tests/test_3d.cc index 33e6a04..88b8db9 100644 --- a/src/tests/test_3d.cc +++ b/src/tests/test_3d.cc @@ -33,10 +33,10 @@ void test_object_transform() { std::cout << "Testing Object Transform..." << std::endl; Object3D obj; obj.position = vec3(10, 0, 0); - + // Model matrix should translate by (10,0,0) mat4 m = obj.get_model_matrix(); - assert(near(m.m[12], 10.0f)); // Col 3, Row 0 is x translation in Col-Major? + assert(near(m.m[12], 10.0f)); // Col 3, Row 0 is x translation in Col-Major? // Wait, my mat4 struct: // r.m[12] = t.x; // Index 12 is translation X assert(near(m.m[12], 10.0f)); @@ -44,11 +44,12 @@ void test_object_transform() { // Rotate 90 deg Y obj.rotation = quat::from_axis(vec3(0, 1, 0), 1.570796f); m = obj.get_model_matrix(); - + // Transform point (1,0,0) -> Rot(0,0,-1) -> Trans(10,0,-1) vec4 p(1, 0, 0, 1); vec4 res = m * p; - assert(near(res.x, 10.0f)); // Rotated vector is (0,0,-1). + (10,0,0) translation -> (10,0,-1) + assert(near(res.x, 10.0f)); // Rotated vector is (0,0,-1). + (10,0,0) + // translation -> (10,0,-1) assert(near(res.z, -1.0f)); } -- cgit v1.2.3