summaryrefslogtreecommitdiff
path: root/demo/MeshInstance.lua
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-11-08 19:59:16 -0600
committersanine-a <sanine.not@pm.me>2020-11-08 19:59:16 -0600
commit7bdeedd394e4b51d4c2ef4a0dd0470ed0492ac5f (patch)
tree956195b60e7d7671700baeb3b49c6a531e9ee30a /demo/MeshInstance.lua
parentc00400ce832f2ab81fdef0ecdf6820a08e596eae (diff)
add Shader and SpatialShader
Diffstat (limited to 'demo/MeshInstance.lua')
-rw-r--r--demo/MeshInstance.lua10
1 files changed, 2 insertions, 8 deletions
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
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~