comparison tests/test_mesh.nim @ 1137:a4aa9f374d44

did: more renaming
author sam <sam@basx.dev>
date Tue, 04 Jun 2024 20:51:22 +0700
parents 71315636ba82
children 02e1d2658ff5
comparison
equal deleted inserted replaced
1136:71315636ba82 1137:a4aa9f374d44
19 var engine = initEngine("Test meshes") 19 var engine = initEngine("Test meshes")
20 const 20 const
21 shaderConfiguration = createShaderConfiguration( 21 shaderConfiguration = createShaderConfiguration(
22 name = "default shader", 22 name = "default shader",
23 inputs = [ 23 inputs = [
24 attr[Vec3f]("position", memoryPerformanceHint = PreferFastRead), 24 Attr[Vec3f]("position", memoryPerformanceHint = PreferFastRead),
25 attr[uint16](MATERIALINDEX_ATTRIBUTE, memoryPerformanceHint = PreferFastRead, perInstance = true), 25 Attr[uint16](MATERIALINDEX_ATTRIBUTE, memoryPerformanceHint = PreferFastRead, perInstance = true),
26 attr[Vec2f]("texcoord_0", memoryPerformanceHint = PreferFastRead), 26 Attr[Vec2f]("texcoord_0", memoryPerformanceHint = PreferFastRead),
27 attr[Mat4]("transform", memoryPerformanceHint = PreferFastWrite, perInstance = true), 27 Attr[Mat4]("transform", memoryPerformanceHint = PreferFastWrite, perInstance = true),
28 ], 28 ],
29 intermediates = [ 29 intermediates = [
30 attr[Vec4f]("vertexColor"), 30 Attr[Vec4f]("vertexColor"),
31 attr[Vec2f]("colorTexCoord"), 31 Attr[Vec2f]("colorTexCoord"),
32 attr[uint16]("materialIndexOut", noInterpolation = true) 32 Attr[uint16]("materialIndexOut", noInterpolation = true)
33 ], 33 ],
34 outputs = [attr[Vec4f]("color")], 34 outputs = [Attr[Vec4f]("color")],
35 uniforms = [ 35 uniforms = [
36 attr[Mat4]("projection"), 36 Attr[Mat4]("projection"),
37 attr[Mat4]("view"), 37 Attr[Mat4]("view"),
38 attr[Vec4f]("color", arrayCount = 4), 38 Attr[Vec4f]("color", arrayCount = 4),
39 ], 39 ],
40 samplers = [attr[Texture]("baseTexture", arrayCount = 4)], 40 samplers = [Attr[Texture]("baseTexture", arrayCount = 4)],
41 vertexCode = &""" 41 vertexCode = &"""
42 gl_Position = vec4(position, 1.0) * (transform * (Uniforms.view * Uniforms.projection)); 42 gl_Position = vec4(position, 1.0) * (transform * (Uniforms.view * Uniforms.projection));
43 vertexColor = Uniforms.color[{MATERIALINDEX_ATTRIBUTE}]; 43 vertexColor = Uniforms.color[{MATERIALINDEX_ATTRIBUTE}];
44 colorTexCoord = texcoord_0; 44 colorTexCoord = texcoord_0;
45 materialIndexOut = {MATERIALINDEX_ATTRIBUTE}; 45 materialIndexOut = {MATERIALINDEX_ATTRIBUTE};