Page 1 of 1

pp.lua - Easily apply multiple post processing shaders!

Posted: Tue Sep 28, 2021 11:42 pm
by veethree
Over the years i've frequently found myself wanting to apply multiple post processing shaders to my game. I would usually just hack something together with a bunch of canvases. Today i found myself in that very situation, So i decided to write a little helper module as a favor to my future self.

Usage:
Load it:

Code: Select all

pp = require("pp")
Create a new pp canvas

Code: Select all

canvas = pp.new(width, height)
Draw something to it:

Code: Select all

canvas:drawTo(function() 
  --draw stuff 
end)
Draw the pp canvas with shaders

Code: Select all

canvas:draw(shader1, shader2, ...)
You can also draw it without shaders.

Code: Select all

canvas:draw()
The shaders will be applied in the order of the arguments.
pp_demo.gif
pp_demo.gif (20.11 MiB) Viewed 10873 times
Photo in the demo by Greg Galas from Pexels

The thing is on github as wel.l

Re: pp.lua - Easily apply multiple post processing shaders!

Posted: Thu Sep 30, 2021 11:24 am
by GVovkiv
m...
pp

Re: pp.lua - Easily apply multiple post processing shaders!

Posted: Thu Sep 30, 2021 11:36 am
by veethree
GVovkiv wrote: Thu Sep 30, 2021 11:24 am m...
pp
post processing. Not dick :)

Re: pp.lua - Easily apply multiple post processing shaders!

Posted: Thu Sep 30, 2021 11:42 am
by GVovkiv
veethree wrote: Thu Sep 30, 2021 11:36 am post processing. Not dick :)
Yeah.. sure
(hehe, pp)

Re: pp.lua - Easily apply multiple post processing shaders!

Posted: Thu Sep 30, 2021 5:43 pm
by Gunroar:Cannon()
Cool

Re: pp.lua - Easily apply multiple post processing shaders!

Posted: Fri Oct 29, 2021 7:43 pm
by Xii
Definitely something I wished for starting out.