Mercurial > games > semicongine
comparison 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 |
comparison
equal
deleted
inserted
replaced
775:b4b3143e3626 | 776:002d9c576756 |
---|---|
124 sampler.magnification = VK_FILTER_NEAREST | 124 sampler.magnification = VK_FILTER_NEAREST |
125 sampler.minification = VK_FILTER_NEAREST | 125 sampler.minification = VK_FILTER_NEAREST |
126 for scene in scenes.mitems: | 126 for scene in scenes.mitems: |
127 scene.addShaderGlobal("time", 0.0'f32) | 127 scene.addShaderGlobal("time", 0.0'f32) |
128 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) | 128 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) |
129 scene.addMaterial(Material(name: "my_material", textures: {"my_little_texture": Texture(image: Image(width: 5, height: 5, imagedata: @[ | 129 scene.addMaterial(Material( |
130 R, R, R, R, R, | 130 name: "my_material", |
131 R, R, W, R, R, | 131 textures: { |
132 R, W, W, W, R, | 132 "my_little_texture": Texture(image: Image(width: 5, height: 5, imagedata: @[ |
133 R, R, W, R, R, | 133 R, R, R, R, R, |
134 R, R, R, R, R, | 134 R, R, W, R, R, |
135 ]), sampler: sampler)}.toTable)) | 135 R, W, W, W, R, |
136 engine.addScene(scene, vertexInput, samplers, transformAttribute="") | 136 R, R, W, R, R, |
137 R, R, R, R, R, | |
138 ]), sampler: sampler) | |
139 }.toTable | |
140 )) | |
141 engine.addScene(scene, vertexInput, samplers, transformAttribute="", materialIndexAttribute="") | |
137 | 142 |
138 # MAINLOOP | 143 # MAINLOOP |
139 echo "Setup successfull, start rendering" | 144 echo "Setup successfull, start rendering" |
140 for i in 0 ..< 3: | 145 for i in 0 ..< 3: |
141 for scene in scenes.mitems: | 146 for scene in scenes.mitems: |