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.
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
moonshine uses double buffering . From what I understand this maybe a issue with the blend mode. Can you check if changing the blend mode in init.lua:75 to this fixes the issue?
And when I work with moonshine for my game “ https://ghosx.itch.io/lost” To make vignette, fog and a little bit of glow, I think that this is the problem.
Or you can take the full screen size and transform it to the left and right.