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: 846
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 1906 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 50 times
pp.lua
v1.0
(2.5 KiB) Downloaded 39 times
User avatar
GVovkiv
Party member
Posts: 183
Joined: Fri Jan 15, 2021 7:29 am
Contact:

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

Post by GVovkiv »

m...
pp
User avatar
veethree
Inner party member
Posts: 846
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: 183
Joined: Fri Jan 15, 2021 7:29 am
Contact:

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: 577
Joined: Thu Dec 10, 2020 1:57 am

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

Post by Gunroar:Cannon() »

Cool
Why can't pirates code in lua? Because they spend to much time at C! :P

-It might look like nonsense :roll: but there's so much proof.
-Some more if you pls... :? .
It has to be real then, all that talk about the end :shock: .
-How to be saved :huh:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests