diff options
author | sanine <sanine.not@pm.me> | 2023-04-19 23:49:38 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-04-19 23:49:38 -0500 |
commit | 445fc5217859a799e3a977c9763141d9a5f6cbb5 (patch) | |
tree | 9fe30aa97fe5d44b1f6fe0f85fe62543f5c2db4b /main.lua | |
parent | 02c6f822e2cca41d5d28afd9f3a05211316587fd (diff) |
add split drawing function and renderQuad component
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -65,6 +65,7 @@ function setupEntities() entities:addComponents(camera, { camera={ projection=Mat4():perspective(math.rad(45), 640/480, 0.1, 100), + render="screen", }, transform={ matrix=Mat4():identity():translate(Vec3{0, 0, -6}), @@ -126,13 +127,22 @@ function setupEntities() entities:addComponents(id2, { renderMesh = { shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, - mesh = { filename="assets/tetrahedron.obj", index=1 }, + --mesh = { filename="assets/tetrahedron.obj", index=1 }, + mesh = { filename="builtin.quad", index=1 }, }, transform = { parent=id, matrix=Mat4():identity():translate(Vec3{0, 2, 0}), }, }) + + local quad = entities:createEntity() + entities:addComponents(quad, { + renderQuad = { + shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, + textures = { ourTexture = { filename = "44d9a0ec1c18e6126a5e9d9d9317f5ac.png" } }, + }, + }) end setupEntities() |