Mercurial > games > semicongine
comparison tests/test_materials.nim @ 1088:ac3025fcc324
fix: tests
author | sam <sam@basx.dev> |
---|---|
date | Sat, 06 Apr 2024 15:27:09 +0700 |
parents | 91e018270832 |
children | a40bb0a48e07 |
comparison
equal
deleted
inserted
replaced
1087:c5655f79070d | 1088:ac3025fcc324 |
---|---|
48 intermediates = [ | 48 intermediates = [ |
49 attr[Vec2f]("uvout"), | 49 attr[Vec2f]("uvout"), |
50 ], | 50 ], |
51 uniforms = [attr[float32]("test2", arrayCount = 2)], | 51 uniforms = [attr[float32]("test2", arrayCount = 2)], |
52 samplers = @[ | 52 samplers = @[ |
53 attr[Texture]("tex1", arrayCount = 1), | 53 attr[Texture]("tex1"), |
54 attr[Texture]("tex2", arrayCount = 1), | 54 attr[Texture]("tex2"), |
55 ], | 55 ], |
56 outputs = [attr[Vec4f]("color")], | 56 outputs = [attr[Vec4f]("color")], |
57 vertexCode = """ | 57 vertexCode = """ |
58 gl_Position = vec4(position.x, position.y + sin(Uniforms.test2[1]) / Uniforms.test2[1] * 0.5, position.z, 1.0); | 58 gl_Position = vec4(position.x, position.y + sin(Uniforms.test2[1]) / Uniforms.test2[1] * 0.5, position.z, 1.0); |
59 uvout = uv;""", | 59 uvout = uv;""", |
60 fragmentCode = """ | 60 fragmentCode = """ |
61 float d = sin(Uniforms.test2[0]) * 0.5 + 0.5; | 61 float d = sin(Uniforms.test2[0]) * 0.5 + 0.5; |
62 color = texture(tex1[0], uvout) * (1 - d) + texture(tex2[0], uvout) * d; | 62 color = texture(tex1, uvout) * (1 - d) + texture(tex2, uvout) * d; |
63 """, | 63 """, |
64 ) | 64 ) |
65 engine.initRenderer({ | 65 engine.initRenderer({ |
66 doubleTextureMaterial: shaderConfiguration1, | 66 doubleTextureMaterial: shaderConfiguration1, |
67 }) | 67 }) |