Is it possible to use Moonshine in a canvas?
Posted: Wed Dec 14, 2022 8:52 pm
I'm trying to use a moonshine effect in canvas so that I only have to render once, but I always get a black screen... I've tried in lots of different orders, in using multiple canvases, etc. but still the same result, I wonder then is this possible with Moonshine?
Here is an example and I put the same code in attachments with the library if you want to try it quickly.
Here is an example and I put the same code in attachments with the library if you want to try it quickly.
Code: Select all
local moonshine = require("moonshine")
local effect = moonshine(moonshine.effects.glow)
effect.glow.min_luma = .7
effect.glow.strength = 8
local canvas = love.graphics.newCanvas()
function love.draw()
-- RIGHT RECT --
effect(function()
love.graphics.rectangle("fill", 650,50,100,100)
end)
-- LEFT RECT - not work --
love.graphics.setCanvas(canvas)
effect(function()
love.graphics.rectangle("fill", 50,50,100,100)
end)
love.graphics.setCanvas()
love.graphics.draw(canvas)
end