diff options
-rw-r--r-- | demo/Node.lua | 7 | ||||
-rw-r--r-- | demo/SpatialShader.lua | 2 | ||||
-rw-r--r-- | demo/main.lua | 8 |
3 files changed, 9 insertions, 8 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 diff --git a/demo/SpatialShader.lua b/demo/SpatialShader.lua index b15859f..68760ef 100644 --- a/demo/SpatialShader.lua +++ b/demo/SpatialShader.lua @@ -34,7 +34,7 @@ out vec4 color; void main() { - color = vec4(texture(albedo, UV).xyz, 1); + color = texture(albedo, UV); } ]] local SpatialShader = {} diff --git a/demo/main.lua b/demo/main.lua index f60c345..f28510c 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -19,14 +19,15 @@ end) local tex = honey.texture.load('lowres.png', {minFilter='nearest', magFilter='nearest'}) -local cairo = honey.cairo() +local cairo = honey.cairo({minFilter='nearest', magFilter='nearest'}) cairo:setColor(1, 1, 1) cairo:moveTo(1024,0) cairo:lineTo(0,1024) cairo:stroke() -cairo:setLineWidth(20); -cairo:arc(512, 512, 256); +cairo:setLineWidth(20) +cairo:setColor(0,0,0) +cairo:arc(512, 512, 256) cairo:stroke() cairo:updateTexture() @@ -82,7 +83,6 @@ function honey.update(dt) sceneRoot:updateCascade(dt) if total_time > 1 then print('FPS: '..tostring(total_frames/total_time)) - print(cairo) total_time = 0 total_frames = 0 end |