Question about coloring images

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
mode7
Prole
Posts: 35
Joined: Tue Aug 21, 2012 5:45 pm
Contact:

Question about coloring images

Post by mode7 »

Hey everybody,

I have a question about coloring my drawings:
Im trying to add a fog effect to my 3d camera. As the distance gets bigger, the fog color is supposed to gradually turn completely opaque. I tried using love.graphics.setColor but it is only possible to 'tint' the drawable in the color. Set the color mode to 'combine' gives better results but still does not solve my problem.
Basically what i want is something like a color overlay with variable opacity that only covers the drawable.

So my question: Is there a) a way to achieve this in love or b) is there a libray/module which does that or c) any idea how to achieve this?

I really hope you can help me
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Question about coloring images

Post by kikito »

Have you tried drawing rectangles of varying opacity on top of the images? With love.graphics.rectangle and love.graphics.setColor, I mean.
When I write def I mean function.
mode7
Prole
Posts: 35
Joined: Tue Aug 21, 2012 5:45 pm
Contact:

Re: Question about coloring images

Post by mode7 »

Already did that.The problem is that you need quite a few rectangles to get a smooth fog effect. This will result in a massive slowdown and I cant see the background anymore.
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Question about coloring images

Post by Ref »

mode7 wrote:Hey everybody,

I have a question about coloring my drawings:
Im trying to add a fog effect to my 3d camera. As the distance gets bigger, the fog color is supposed to gradually turn completely opaque. I tried using love.graphics.setColor but it is only possible to 'tint' the drawable in the color. Set the color mode to 'combine' gives better results but still does not solve my problem.
Basically what i want is something like a color overlay with variable opacity that only covers the drawable.

So my question: Is there a) a way to achieve this in love or b) is there a libray/module which does that or c) any idea how to achieve this?

I really hope you can help me
setPixelEffect
mode7
Prole
Posts: 35
Joined: Tue Aug 21, 2012 5:45 pm
Contact:

Re: Question about coloring images

Post by mode7 »

Thanks for the detailed answer ;)
You're right shaders are the way to go here. Unfortunately I don't know anything about GL or GLSL. I would be totally thankful for everything that puts me in the right direction.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 56 guests