whitebear wrote:Wow, this works really well. Even under some stress test didn't seem to slow down. got to about 70+ lightsources until I saw fps drop.
Thanks, I'm pretty proud of the render method myself since it can handle a lot of lights before it reaches a bottleneck state. It's really efficient given that the scene canvas is small enough.
drikdrok wrote:This looks really nice! I noticed that this does not Work with cameras like hump. What be would a solution to that be? I suspect it has something to do with the canvas. But i have never worked the love canvas before...
Yeah, light doesn't work with most camera libs.. I don't know how they work but essencialy .generateShadows() only renderes shadows to the scene that is provided, so first you need to draw your scene into a canvas instead of drawing it direcly to the screen, then pass that canvas to .generateShadows() and draw the output and the scene canvas, here's how you save thing into a canvas:
Code: Select all
function love.load()
scene = love.graphics.newCanvas()
end
function love.draw()
love.graphics.setCanvas()
love.graphics.clear()
--draw everything in here
love.graphics.setCanvas()
love.graphics.draw(light.generateShadows(scene)
love.graphics.draw(scene)
end
I'll look into this after I'm done with the next update.