summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
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)