pp.lua - Easily apply multiple post processing shaders!

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

pp.lua - Easily apply multiple post processing shaders!

Post 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 10290 times
Photo in the demo by Greg Galas from Pexels

The thing is on github as wel.l
Attachments
pp_demo.love
(95.09 KiB) Downloaded 256 times
pp.lua
v1.0
(2.5 KiB) Downloaded 247 times
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

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

Post by veethree »

GVovkiv wrote: Thu Sep 30, 2021 11:24 am m...
pp
post processing. Not dick :)
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

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

Post by GVovkiv »

veethree wrote: Thu Sep 30, 2021 11:36 am post processing. Not dick :)
Yeah.. sure
(hehe, pp)
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

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

Post by Gunroar:Cannon() »

Cool
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

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

Post by Xii »

Definitely something I wished for starting out.
Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests