wondering how to blend a gradient on top of an item, but nothing else

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Nikki
Prole
Posts: 18
Joined: Wed Jan 25, 2017 5:42 pm

wondering how to blend a gradient on top of an item, but nothing else

Post by Nikki » Thu Feb 23, 2017 5:34 pm

So I have a bird made up out of smaller parts,
Image

I'd like to put a gradient on it's bottom parts to make it look like its under murky water
If I just blend multiply that gradient on top I get this as a result,
Image

I'd like something like this (made in PS)
Image

How do I achieve this effect?
I need it i runtime so i can tween the gradient a little back simulating water movement and tween it away when th bitd is ocoming out of the water, also the feet will be animated. So icannot just combine this gradient in photoshop it needs to be done smarter,

thanks in advance!

User avatar
Nikki
Prole
Posts: 18
Joined: Wed Jan 25, 2017 5:42 pm

Re: wondering how to blend a gradient on top of an item, but nothing else

Post by Nikki » Thu Feb 23, 2017 5:50 pm

ok sorry, for asking without researching properly, the answer is : by using a Canvas.

User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Somewhere in Brazil
Contact:

Re: wondering how to blend a gradient on top of an item, but nothing else

Post by HugoBDesigner » Thu Feb 23, 2017 8:35 pm

You can use a stencil. Copy the drawing of the bird parts to a stencil, then draw the gradient using that same stencil. love.graphics.stencil

EDIT: To use a stencil you'll need shaders, forgot to add that.
HugoBDesigner - my Twitter
HugoBDesigner - my Blog

User avatar
Nixola
Inner party member
Posts: 1935
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: wondering how to blend a gradient on top of an item, but nothing else

Post by Nixola » Thu Feb 23, 2017 8:48 pm

And if he's using shaders he might as well not use a stencil...
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

Post Reply

Who is online

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