summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-05-12 15:06:13 -0500
committersanine-a <sanine.not@pm.me>2023-05-12 15:06:13 -0500
commit759db92cf135aba21f0cbd17073d2f2e294fdf4d (patch)
tree8f0c875217ef2434d898c6c8df1775340f93a986 /main.lua
parent0d96ebc90c9740e7e66a70aa11168b11f49d220b (diff)
add nice builtin shaders
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua28
1 files changed, 25 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index c251071..60cc174 100644
--- a/main.lua
+++ b/main.lua
@@ -26,6 +26,26 @@ db:createEntityWithComponents{
},
}
+-- skybox
+db:createEntityWithComponents{
+ node = {
+ matrix = Mat4()
+ :identity(),
+ },
+ renderMesh = {
+ mesh = {
+ filename = "assets/skybox.obj",
+ index = 1,
+ },
+ uniforms = {
+ textures = {
+ surface = { filename = "starfield2.png" },
+ },
+ },
+ shader = { vertex = "builtin.basic3d.vert", fragment = "builtin.flat.frag" },
+ },
+}
+
-- mesh
db:createEntityWithComponents{
node = {
@@ -37,15 +57,17 @@ db:createEntityWithComponents{
filename = "assets/dodecahedron.obj",
index = 1,
},
- textures = {
- ourTexture = { filename = "assets/green-grass.jpg" },
+ uniforms = {
+ textures = {
+ ourTexture = { filename = "assets/green-grass.jpg" },
+ },
},
shader = { vertex="vertex.glsl", fragment="fragment.glsl" },
},
}
honey.loop(function(dt)
- gl.ClearColor(0.2, 0.4, 1.0, 1.0)
+ gl.ClearColor(0xa/0xff, 0x10/0xff, 0x1f/0xff, 1.0)
gl.Clear(gl.COLOR_BUFFER_BIT + gl.DEPTH_BUFFER_BIT + gl.STENCIL_BUFFER_BIT)
systems:update(dt)
end)