summaryrefslogtreecommitdiff
path: root/src/tests/3d/test_3d_render.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/3d/test_3d_render.cc')
-rw-r--r--src/tests/3d/test_3d_render.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/3d/test_3d_render.cc b/src/tests/3d/test_3d_render.cc
index bd301bd..de9718e 100644
--- a/src/tests/3d/test_3d_render.cc
+++ b/src/tests/3d/test_3d_render.cc
@@ -102,6 +102,17 @@ bool gen_periodic_noise(uint8_t* buffer, int w, int h, const float* params,
return procedural::make_periodic(buffer, w, h, p_params, 1);
}
+// Wrapper: fBm noise → normal map
+bool gen_fbm_normalmap(uint8_t* buffer, int w, int h, const float* params,
+ int num_params) {
+ (void)params; (void)num_params;
+ float fbm_params[] = {0.0f, 4.0f, 1.0f, 0.5f, 5.0f};
+ if (!procedural::gen_perlin(buffer, w, h, fbm_params, 5))
+ return false;
+ float nm_params[] = {8.0f};
+ return procedural::gen_normalmap(buffer, w, h, nm_params, 1);
+}
+
int main(int argc, char** argv) {
printf("Running 3D Renderer Test...\n");
@@ -134,6 +145,32 @@ int main(int argc, char** argv) {
setup_standard_textures(g_renderer, g_textures, g_device, g_queue);
+ // Plasma → sky texture
+ ProceduralTextureDef plasma_def;
+ plasma_def.width = 256;
+ plasma_def.height = 256;
+ plasma_def.gen_func = procedural::gen_plasma;
+ plasma_def.params = {0.0f, 3.0f}; // time=0, freq=3
+ g_textures.create_procedural_texture("plasma", plasma_def);
+ g_renderer.set_sky_texture(g_textures.get_texture_view("plasma"));
+
+ // Voronoi (F2-F1 borders) → noise texture
+ ProceduralTextureDef voronoi_def;
+ voronoi_def.width = 256;
+ voronoi_def.height = 256;
+ voronoi_def.gen_func = procedural::gen_voronoi;
+ voronoi_def.params = {8.0f, 2.0f, 42.0f}; // scale=8, mode=F2-F1, seed=42
+ g_textures.create_procedural_texture("voronoi", voronoi_def);
+ g_renderer.set_noise_texture(g_textures.get_texture_view("voronoi"));
+
+ // fBm normal map (stored for material/debug use)
+ ProceduralTextureDef normalmap_def;
+ normalmap_def.width = 256;
+ normalmap_def.height = 256;
+ normalmap_def.gen_func = gen_fbm_normalmap;
+ normalmap_def.params = {};
+ g_textures.create_procedural_texture("normalmap", normalmap_def);
+
// GPU Grid texture (additional texture for this test)
GpuProceduralParams grid_params = {};
grid_params.width = 256;