summaryrefslogtreecommitdiff
path: root/src/tests/test_texture_manager.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_texture_manager.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_texture_manager.cc')
-rw-r--r--src/tests/test_texture_manager.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/tests/test_texture_manager.cc b/src/tests/test_texture_manager.cc
index 7f40447..5741d8c 100644
--- a/src/tests/test_texture_manager.cc
+++ b/src/tests/test_texture_manager.cc
@@ -1,5 +1,6 @@
// This file is part of the 64k demo project.
-// It tests the TextureManager (mocking the GPU parts where possible or running with valid device).
+// It tests the TextureManager (mocking the GPU parts where possible or running
+// with valid device).
#include "gpu/texture_manager.h"
#include "procedural/generator.h"
@@ -15,28 +16,33 @@
// Forward decls from platform.h or similar (simplifying for test)
// Note: This test requires a valid WebGPU device, which is hard in CI/headless.
// We will structure it to compile, but runtime might skip if no device.
-// For now, we just test the C++ side logic if possible, but TextureManager depends heavily on WGPU calls.
+// For now, we just test the C++ side logic if possible, but TextureManager
+// depends heavily on WGPU calls.
// We will use a "Headless" approach if possible, or just skip if Init fails.
-// Actually, let's just make it a compilation test + basic logic check if we can mock or stub.
-// Since we don't have a mocking framework, we'll try to init wgpu-native.
+// Actually, let's just make it a compilation test + basic logic check if we can
+// mock or stub. Since we don't have a mocking framework, we'll try to init
+// wgpu-native.
int main() {
- // Need to init GLFW for surface creation usually, even for headless in some impls?
+ // Need to init GLFW for surface creation usually, even for headless in some
+ // impls?
if (!glfwInit()) {
std::cerr << "Failed to init GLFW" << std::endl;
return 1;
}
-
+
// NOTE: In a real CI environment without GPU, this will likely fail or hang.
- // For this "demo" context, we assume the user has a GPU or we just verify it compiles.
- // We'll skip actual GPU init for this simple test to avoid hanging the agent if no GPU.
+ // For this "demo" context, we assume the user has a GPU or we just verify it
+ // compiles. We'll skip actual GPU init for this simple test to avoid hanging
+ // the agent if no GPU.
std::cout << "TextureManager Compilation Test Passed." << std::endl;
-
+
/*
TextureManager tm;
// tm.init(device, queue); // execution would happen here
- // tm.create_procedural_texture("noise", {256, 256, procedural::gen_noise, {1234, 1.0f}});
+ // tm.create_procedural_texture("noise", {256, 256, procedural::gen_noise,
+ {1234, 1.0f}});
*/
return 0;