From 71dc88f9379f379ee0287b1ef2b62c57c6445099 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 15 Dec 2020 21:08:36 -0600 Subject: fix bugs in texture parameter setting and add low-resolution to demo --- demo/lowres.png | Bin 0 -> 210 bytes demo/main.lua | 34 +++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 demo/lowres.png (limited to 'demo') diff --git a/demo/lowres.png b/demo/lowres.png new file mode 100644 index 0000000..25abad2 Binary files /dev/null and b/demo/lowres.png differ diff --git a/demo/main.lua b/demo/main.lua index b956d04..34f9e6f 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -11,7 +11,7 @@ honey.input.key.bind(honey.input.key.escape, honey.exit) local buffer = false honey.input.key.bind(honey.input.key.f, function(action) if action == 1 then buffer = not buffer end end) -local tex = honey.texture.load('checkerboard.png') + local tex = honey.texture.load('lowres.png', {minFilter='nearest', magFilter='nearest'}) local sceneRoot = Node.new() @@ -28,18 +28,26 @@ local suzanne = MeshInstance.new(sceneRoot, meshes[1], shader) print(suzanne.mesh) -local plane = MeshInstance.new(suzanne, - honey.glm.vec3{1,0,0}, - honey.glm.vec3{0,0,0}, - honey.glm.vec3{1,1,1}, - Primitives.plane(4,4), - shader) --- local plane2 = MeshInstance.new(suzanne, --- honey.glm.vec3{5,0,0}, --- honey.glm.vec3{0,math.pi,0}, --- honey.glm.vec3{1,1,1}, --- honey.primitives.plane(4,4), --- shader) +--local plane = MeshInstance.new(suzanne, +-- honey.glm.vec3{1,0,0}, +-- honey.glm.vec3{0,0,0}, +-- honey.glm.vec3{1,1,1}, +-- Primitives.plane(4,4), +-- shader) + +MeshInstance.new(sceneRoot, + honey.glm.vec3{0,0,3}, + honey.glm.vec3{0,0,0}, + honey.glm.vec3{1,1,1}, + Primitives.plane(4,4), + shader) + +MeshInstance.new(sceneRoot, + honey.glm.vec3{4,0,3}, + honey.glm.vec3{0,math.pi,0}, + honey.glm.vec3{1,1,1}, + Primitives.plane(4,4), + shader) suzanne.update = function(self, dt) self:rotate('y', dt) -- cgit v1.2.1