Mercurial > games > semicongine
comparison tests/test_vulkan_wrapper.nim @ 371:f054b8bacab8
fix: tests, test_materials and test_mesh still needs to be done
author | Sam <sam@basx.dev> |
---|---|
date | Wed, 22 Nov 2023 23:24:47 +0700 |
parents | 51ee41c1d8ed |
children | fa38cd28f041 |
comparison
equal
deleted
inserted
replaced
370:fad6490fb728 | 371:f054b8bacab8 |
---|---|
12 ) | 12 ) |
13 (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) | 13 (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) |
14 mat = SINGLE_TEXTURE_MATERIAL.initMaterialData( | 14 mat = SINGLE_TEXTURE_MATERIAL.initMaterialData( |
15 name="mat", | 15 name="mat", |
16 attributes={ | 16 attributes={ |
17 "texture1": initDataList(@[Texture(image: Image(width: 5, height: 5, imagedata: @[ | 17 "baseTexture": initDataList(@[Texture(image: Image(width: 5, height: 5, imagedata: @[ |
18 R, R, R, R, R, | 18 R, R, R, R, R, |
19 R, R, W, R, R, | 19 R, R, W, R, R, |
20 R, W, W, W, R, | 20 R, W, W, W, R, |
21 R, R, W, R, R, | 21 R, R, W, R, R, |
22 R, R, R, R, R, | 22 R, R, R, R, R, |
24 }.toTable | 24 }.toTable |
25 ) | 25 ) |
26 mat2 = SINGLE_TEXTURE_MATERIAL.initMaterialData( | 26 mat2 = SINGLE_TEXTURE_MATERIAL.initMaterialData( |
27 name="mat2", | 27 name="mat2", |
28 attributes={ | 28 attributes={ |
29 "texture1": initDataList(@[Texture(image: Image(width: 5, height: 5, imagedata: @[ | 29 "baseTexture": initDataList(@[Texture(image: Image(width: 5, height: 5, imagedata: @[ |
30 R, W, R, W, R, | 30 R, W, R, W, R, |
31 W, R, W, R, W, | 31 W, R, W, R, W, |
32 R, W, R, W, R, | 32 R, W, R, W, R, |
33 W, R, W, R, W, | 33 W, R, W, R, W, |
34 R, W, R, W, R, | 34 R, W, R, W, R, |
178 intermediates=[ | 178 intermediates=[ |
179 attr[Vec4f]("outcolor"), | 179 attr[Vec4f]("outcolor"), |
180 ], | 180 ], |
181 outputs=[attr[Vec4f]("color")], | 181 outputs=[attr[Vec4f]("color")], |
182 samplers=[ | 182 samplers=[ |
183 attr[Texture]("texture1") | 183 attr[Texture]("baseTexture") |
184 ], | 184 ], |
185 vertexCode="""gl_Position = vec4(position, 1.0) * transform; outcolor = color;""", | 185 vertexCode="""gl_Position = vec4(position, 1.0) * transform; outcolor = color;""", |
186 fragmentCode="color = texture(texture1, outcolor.xy) * 0.5 + outcolor * 0.5;", | 186 fragmentCode="color = texture(baseTexture, outcolor.xy) * 0.5 + outcolor * 0.5;", |
187 ) | 187 ) |
188 shaderConfiguration2 = createShaderConfiguration( | 188 shaderConfiguration2 = createShaderConfiguration( |
189 inputs=[ | 189 inputs=[ |
190 attr[Vec3f]("position", memoryPerformanceHint=PreferFastRead), | 190 attr[Vec3f]("position", memoryPerformanceHint=PreferFastRead), |
191 attr[Mat4]("transform", perInstance=true), | 191 attr[Mat4]("transform", perInstance=true), |