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
Citizen
Posts: 83
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 »

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
Citizen
Posts: 83
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 »

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: Above the Pocket Dimension
Contact:

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

Post by HugoBDesigner »

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 - Twitter
HugoBDesigner - Blog
User avatar
Nixola
Inner party member
Posts: 1949
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 »

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: No registered users and 55 guests