summaryrefslogtreecommitdiff
path: root/src/tests/test_3d.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 11:31:00 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 11:31:00 +0100
commitf80e37bd61e447f1d66fbb5eb4c1ab7a8a77cf0f (patch)
treed6c06e4c9e6d2570458d88d35acba9e64231cbc0 /src/tests/test_3d.cc
parentf307cde4ac1126e38c5595ce61a26d50cdd7ad4a (diff)
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).
Diffstat (limited to 'src/tests/test_3d.cc')
-rw-r--r--src/tests/test_3d.cc9
1 files changed, 5 insertions, 4 deletions
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));
}