function love.load()
require("metaballs")
metaballs.create(8) -- spawn 8 metaballs
end
function love.draw()
love.graphics.draw(metaballs.surface(),0,0)
end
function love.update(dt)
metaballs.update(dt)
end
Looks nice! I played around with it for a bit and made some optimizations. The calculation is now done in a shader, and the texture is not recreated every frame. It's quickly hacked in though, so the code is far from optimal and not very pretty.
grump wrote: ↑Thu Aug 01, 2019 2:18 pm
Looks nice! I played around with it for a bit and made some optimizations. The calculation is now done in a shader, and the texture is not recreated every frame. It's quickly hacked in though, so the code is far from optimal and not very pretty.
Hey, that's cool. Yeah, runs much faster as a shader. I still haven't a clue at writing things via shader language, will have to dig into that more in the future.