summaryrefslogtreecommitdiff
path: root/demo/Node.lua
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-12-18 20:20:26 -0600
committersanine-a <sanine.not@pm.me>2020-12-18 20:20:26 -0600
commit91b914bc0eb97a76f2c3a1caa64fdfde29ca16a1 (patch)
treebf038b561eb80461c4b902ff350b813e4b48699d /demo/Node.lua
parent1b7a7a0d83353c9d4e67387d864011b1556330eb (diff)
add draw filtering and alpha to SpatialShader output
Diffstat (limited to 'demo/Node.lua')
-rw-r--r--demo/Node.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/demo/Node.lua b/demo/Node.lua
index 7bd1ad5..6177fc5 100644
--- a/demo/Node.lua
+++ b/demo/Node.lua
@@ -32,14 +32,15 @@ Node.prototype.updateCascade = function(self, dt)
end
end
-Node.prototype.drawCascade = function(self, camera, shader)
- if self.draw then
+Node.prototype.drawCascade = function(self, camera, shader, filter)
+ filter = filter or function(node) return true end
+ if self.draw and filter(self) then
self:draw(camera, shader)
end
-- do not draw base nodes, but recursively draw children.
for _, child in ipairs(self.children) do
- child:drawCascade(camera, shader)
+ child:drawCascade(camera, shader, filter)
end
end