Mercurial > games > semicongine
comparison tests/test_mesh.nim @ 244:f52fccedf5ab
did: adjust to new API
author | Sam <sam@basx.dev> |
---|---|
date | Mon, 22 May 2023 00:51:41 +0700 |
parents | f05497ef8fd2 |
children | a19c9d089f25 |
comparison
equal
deleted
inserted
replaced
243:3b388986c7fd | 244:f52fccedf5ab |
---|---|
16 attr[Vec3f]("position", memoryPerformanceHint=PreferFastRead), | 16 attr[Vec3f]("position", memoryPerformanceHint=PreferFastRead), |
17 attr[uint8]("material", memoryPerformanceHint=PreferFastRead), | 17 attr[uint8]("material", memoryPerformanceHint=PreferFastRead), |
18 ] | 18 ] |
19 vertexOutput = @[attr[Vec4f]("vertexColor")] | 19 vertexOutput = @[attr[Vec4f]("vertexColor")] |
20 fragOutput = @[attr[Vec4f]("color")] | 20 fragOutput = @[attr[Vec4f]("color")] |
21 uniforms = @[attr[Mat4]("transform"), attr[Vec4f]("material_colors", arrayCount=16), ] | 21 uniforms = @[attr[Mat4]("transform"), attr[Vec4f]("material_color", arrayCount=16), ] |
22 vertexCode = compileGlslShader( | 22 vertexCode = compileGlslShader( |
23 stage=VK_SHADER_STAGE_VERTEX_BIT, | 23 stage=VK_SHADER_STAGE_VERTEX_BIT, |
24 inputs=vertexInput, | 24 inputs=vertexInput, |
25 outputs=vertexOutput, | 25 outputs=vertexOutput, |
26 uniforms=uniforms, | 26 uniforms=uniforms, |
27 main="""gl_Position = vec4(position, 1.0) * Uniforms.transform; vertexColor = Uniforms.material_colors[material];""" | 27 main="""gl_Position = vec4(position, 1.0) * Uniforms.transform; vertexColor = Uniforms.material_color[material];""" |
28 ) | 28 ) |
29 fragmentCode = compileGlslShader( | 29 fragmentCode = compileGlslShader( |
30 stage=VK_SHADER_STAGE_FRAGMENT_BIT, | 30 stage=VK_SHADER_STAGE_FRAGMENT_BIT, |
31 inputs=vertexOutput, | 31 inputs=vertexOutput, |
32 outputs=fragOutput, | 32 outputs=fragOutput, |