diff tests/test_vulkan_wrapper.nim @ 776:002d9c576756

did: preparations to refactor material system, still tons to do
author Sam <sam@basx.dev>
date Sun, 23 Jul 2023 19:53:10 +0700
parents a4c757f5d17f
children b145a05c2459
line wrap: on
line diff
--- a/tests/test_vulkan_wrapper.nim	Sun Jul 09 17:40:46 2023 +0700
+++ b/tests/test_vulkan_wrapper.nim	Sun Jul 23 19:53:10 2023 +0700
@@ -126,14 +126,19 @@
   for scene in scenes.mitems:
     scene.addShaderGlobal("time", 0.0'f32)
     let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8])
-    scene.addMaterial(Material(name: "my_material", textures: {"my_little_texture": Texture(image: Image(width: 5, height: 5, imagedata: @[
-      R, R, R, R, R,
-      R, R, W, R, R,
-      R, W, W, W, R,
-      R, R, W, R, R,
-      R, R, R, R, R,
-    ]), sampler: sampler)}.toTable))
-    engine.addScene(scene, vertexInput, samplers, transformAttribute="")
+    scene.addMaterial(Material(
+      name: "my_material",
+      textures: {
+        "my_little_texture": Texture(image: Image(width: 5, height: 5, imagedata: @[
+        R, R, R, R, R,
+        R, R, W, R, R,
+        R, W, W, W, R,
+        R, R, W, R, R,
+        R, R, R, R, R,
+        ]), sampler: sampler)
+      }.toTable
+    ))
+    engine.addScene(scene, vertexInput, samplers, transformAttribute="", materialIndexAttribute="")
 
   # MAINLOOP
   echo "Setup successfull, start rendering"