I'm making this small renderer using shaders. I'm complety at a loss on how to render multiple frames using shaders and afterwards average them together.
I've tried rendering a single frame on a canvas then afterwards adding this canvas to another with
Code: Select all
love.graphics.setBlendMode("add")
Code: Select all
--initialize Render canvas
Render = love.graphics.newCanvas(
Width,
Height,
{
type = "2d",
format = "rgba32f",
readable = true,
msaa = 0,
dpiscale = love.graphics.getDPIScale(),
mipmaps = "none"
}
)
--render single Frame
local Frame = love.graphics.newCanvas(Width,Height)
love.graphics.setCanvas(Frame)
love.graphics.setBlendMode("alpha")
love.graphics.setShader(RenderShader)
love.graphics.rectangle("fill",0,0,Width,Heigh)
--add frame to Render
love.graphics.setCanvas(Render)
love.graphics.setBlendMode("add")
love.graphics.setShader()
love.graphics.draw(Frame)
--draw average Render to screen
love.graphics.setCanvas()
love.graphics.setBlendMode("alpha")
love.graphics.setShader(PostShader)
love.graphics.draw(Render)
Anyone knows a way to do this correctly?