Love2D Gradients

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
DumpOnIt
Prole
Posts: 30
Joined: Fri Apr 06, 2012 6:59 am

Love2D Gradients

Post by DumpOnIt »

Hey everyone! I want remake a game I worked on (and got bored of) over a year ago. It was made in Flash and was an adventure game that made heavy use of gradients. Here is what the original Flash version looked like:



That's is a lot of gradient action! Are there any ways to make gradients work quickly like this in love?

Edit: Changed the video to a more recent one.
Last edited by DumpOnIt on Sun Oct 20, 2013 8:56 am, edited 1 time in total.
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Love2D Gradients

Post by Azhukar »

You can make gradients using shaders http://www.love2d.org/wiki/PixelEffect
User avatar
Helvecta
Party member
Posts: 167
Joined: Wed Sep 26, 2012 6:35 pm

Re: Love2D Gradients

Post by Helvecta »

On a somewhat related note, that video had me rolling balls, dude :ultrashocked:
"Bump." -CMFIend420
User avatar
DumpOnIt
Prole
Posts: 30
Joined: Fri Apr 06, 2012 6:59 am

Re: Love2D Gradients

Post by DumpOnIt »

Azhukar wrote:You can make gradients using shaders http://www.love2d.org/wiki/PixelEffect
I don't know anything about shaders. I don't understand them to the point where they seem like magic! I'll look into that stuff, though. I just need a simple example to build off of, like a red square! The documentation at http://www.opengl.org/sdk/docs/manglsl/ is a little bit crazy!

There is also a sweet snippet at http://love2d.org/wiki/Gradients, but I'm still writing the animation part of the gradient maker, so I'm not sure if it will be fast enough yet.
Helvecta wrote:On a somewhat related note, that video had me rolling balls, dude :ultrashocked:
Haha, that's rockin'! I switched the video now. (I accidentally put the old first development video)
Automatik
Citizen
Posts: 57
Joined: Sun Feb 17, 2013 7:05 pm

Re: Love2D Gradients

Post by Automatik »

Yeah, the wiki method is way better than shaders here: It's faster and more reliable.
And to do a circular gradient, you can generate an image that look like a "ball" with imagedata:mapPixel(), then draw it where you want.
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Love2D Gradients

Post by Azhukar »

Automatik wrote:Yeah, the wiki method is way better than shaders here: It's faster
Not for what he wants to do. In his game he used changing gradients.
Automatik wrote:and more reliable.
Both are as reliable as you code them, the only issue may arise from ancient hardware that does not support shaders.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests