From 7bdeedd394e4b51d4c2ef4a0dd0470ed0492ac5f Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sun, 8 Nov 2020 19:59:16 -0600 Subject: add Shader and SpatialShader --- demo/MeshInstance.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'demo/MeshInstance.lua') diff --git a/demo/MeshInstance.lua b/demo/MeshInstance.lua index a3e6da2..b12edba 100644 --- a/demo/MeshInstance.lua +++ b/demo/MeshInstance.lua @@ -8,14 +8,8 @@ setmetatable(MeshInstance.prototype, { __index = Node.prototype}) MeshInstance.prototype.draw = function(self, camera, shader) local shader = shader or self.shader - honey.shader.set_mat4(shader, 'model', self.transform.array) - honey.shader.set_mat4(shader, 'view', camera.view.array) - honey.shader.set_mat4(shader, 'projection', camera.projection.array) - honey.mesh.draw(self.mesh, shader) - - for _, child in ipairs(self.children) do - child:draw(camera) - end + shader:setCamera(camera) + shader:drawMesh(self) end -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.1