Scent System

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
Taviszorn
Prole
Posts: 1
Joined: Mon Feb 21, 2022 3:14 pm

Scent System

Post by Taviszorn »

Hello!

I want to implement a scent-like system in my program. It would work in a way, that if there is color on the canvas, then it would spread to the pixels nearby (kinda like a blur) and disappear over time. I imagine it would look like the colors diffuse, which is what I want.
Do I need some sort of shader to do this? If so, how? I don't really understand how they work, so any help would be really appreciated!

Thank You in advance!
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: Scent System

Post by darkfrei »

:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Scent System

Post by veethree »

The way I see it you have 2 options. You can use a shader, check out this blog post for a basic primer on how they work. Or you could use a cellular automaton.

If your game is grid based in some way a cellular automaton might be the better option, otherwise shaders.

This kind of shader could make use of convolution matrices, check out this video for a primer
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Scent System

Post by knorke »

Another way could be to use a particle system. Particles that slowly drift away and fade out.
Löve's particle system: https://love2d.org/wiki/ParticleSystem
Post Reply

Who is online

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