[effect] Fog fx

Share your Construct 2 effect files

Post » Tue Jun 07, 2016 3:25 pm

Another cool stuff quickly ported in 2 minutes.

Fog effect for misty scenes..
Live demo:

http://gigatron3k.free.fr/html5/C2/FX/fog

Latest fx file : http://gigatron3k.free.fr/html5/C2/FX/fogfx.rar

Contact me for special parameters like direction speed density etc....
Last edited by Gigatron on Thu Jun 16, 2016 4:38 pm, edited 1 time in total.
http://gigatron3k.free.fr/Intro/

https://www.shadertoy.com/user/gigatron

https://twitter.com/realistquantum

Ezekiel 1-4 ; ufo landing explanation ..

CONSTRUCT 2 THE ONLY FAST WAY TO HTML5

Image
B
57
S
20
G
29
Posts: 804
Reputation: 21,969

Post » Wed Jun 08, 2016 1:27 am

Nice, again!

I was actually looking to make some fog effects for my current project so this might do the job nicely.

I'm hoping to be able to create some fog on a given layer, but "mask" it from certain areas. For example, I want the fog to always be "on top" of any game characters, but only outside of a structure and not inside. The character is always "on top" of the structure (since the structure is a cut-away side view) but I want them to be "behind" the fog.

Is there a good/simple way to mask the fog effect from any given area?

Thanks!
~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Thu Jun 09, 2016 1:43 pm

SoldjahBoy wrote:Nice, again!

I was actually looking to make some fog effects for my current project so this might do the job nicely.

I'm hoping to be able to create some fog on a given layer, but "mask" it from certain areas. For example, I want the fog to always be "on top" of any game characters, but only outside of a structure and not inside. The character is always "on top" of the structure (since the structure is a cut-away side view) but I want them to be "behind" the fog.

Is there a good/simple way to mask the fog effect from any given area?

Thanks!
~Sol


Can you explain your request by an image.. ?
Thanks
http://gigatron3k.free.fr/Intro/

https://www.shadertoy.com/user/gigatron

https://twitter.com/realistquantum

Ezekiel 1-4 ; ufo landing explanation ..

CONSTRUCT 2 THE ONLY FAST WAY TO HTML5

Image
B
57
S
20
G
29
Posts: 804
Reputation: 21,969

Post » Thu Jun 09, 2016 2:11 pm

Depends on your layout sizes and the amount of exits, maybe you can just add collision triggers, that will bring the player to in front of structure/bottom, it'll probably be more efficient for rendering too, as long as you don't actually need to cut the image or mask out a certain shape, I wouldn't go with masking.
Image
B
71
S
28
G
12
Posts: 515
Reputation: 12,284

Post » Fri Jun 10, 2016 8:09 am

@Gigatron

Sure, here is a picture of pretty much what I'm looking to do:
Image

Hoping "fog" can be extended to other "weather" style effects too, like rain/snow.

@Lof

I'm using layers to significantly help with z-ordering... as it stands, the way I'd like to implement fog, I couldn't have everything on the same layer and use simple z-ordering anyway, since the fog would have to be both in-front of things AND behind things at the same time.

As pictured, the "structure" has to be behind the "actors", but in front of the fog - and the "actors" have to be in front of the "structure".

The only way I can think of to do this, is to have the fog opacity set to "0" if overlapping the structure, but this would create a "soft finish" around the structure (unless my fog sprites/particles were very small and in great numbers) - which is not ideal for performance.

I was hoping for a mask of some sort to define where the fog would be omitted on the layer set up for fog (which would preferably be in front of everything else). I'd like to make this layer a "weather" layer ideally... so I can do fog/rain/snow etc.

Perhaps there's a better way to do this entirely? I'm not sure!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Mon Jun 13, 2016 8:47 am

@SoldjahBoy

Ok... it's on the way; you must not apply this shader to layer or layout but to sprite. So the sprite become
the mysterious Vtex (shader running inside this). Simply pin sprite to the visible area of your game(must follow the scene) after
this use Z order command to move the Fog under or upper the structure and the actor.

Will try to add rain lightning etc... before July.
Regards
http://gigatron3k.free.fr/Intro/

https://www.shadertoy.com/user/gigatron

https://twitter.com/realistquantum

Ezekiel 1-4 ; ufo landing explanation ..

CONSTRUCT 2 THE ONLY FAST WAY TO HTML5

Image
B
57
S
20
G
29
Posts: 804
Reputation: 21,969

Post » Mon Jun 13, 2016 10:11 am

OH awesome!

Thanks Gigatron - just one question though if it pins to a sprite (my character), what will happen if there is many instances of this character? My character is going to be used for every character in game (just re-texture each part to make them look differently) so if I understand how you explain it - what will happen if I have this effect pinned to many characters at once?

I guess the problem I have is that; with many characters, one or two may be outside while the rest are inside - maybe I need to just have some extra layers and "move" the character who is outside to a layer that is further behind?

I can't wait to see the extra weather effect though - that will be awesome!

Thanks again :D
~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Mon Jun 13, 2016 10:18 am

SoldjahBoy wrote:OH awesome!

Thanks Gigatron - just one question though if it pins to a sprite (my character), what will happen if there is many instances of this character? My character is going to be used for every character in game (just re-texture each part to make them look differently) so if I understand how you explain it - what will happen if I have this effect pinned to many characters at once?

I guess the problem I have is that; with many characters, one or two may be outside while the rest are inside - maybe I need to just have some extra layers and "move" the character who is outside to a layer that is further behind?

I can't wait to see the extra weather effect though - that will be awesome!

Thanks again :D
~Sol

I will make an example for you .. in fact you must just use Z order for your objects.
http://gigatron3k.free.fr/Intro/

https://www.shadertoy.com/user/gigatron

https://twitter.com/realistquantum

Ezekiel 1-4 ; ufo landing explanation ..

CONSTRUCT 2 THE ONLY FAST WAY TO HTML5

Image
B
57
S
20
G
29
Posts: 804
Reputation: 21,969

Post » Mon Jun 13, 2016 12:19 pm

@Gigatron
It's all good, I made some workaround with my layering... I now have two layers that characters can exist on - one which is on top of the structure layer, and one that is behind the weather layer.

My layers now look something like this;
1. ACTOR
2. BUILDING
3. WEATHER
4. ACTOR 2

So I've made some events to simply move the character to another layer behind where the effects will be - but if you want to make an example to show what you mean then that would still be helpful - maybe I've made this extra work for no reason :)

Thanks again :D
~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Mon Jun 13, 2016 4:09 pm

I understand more and more the complexity of the problem , however, playing with glsl alpha
will hope solve the problem.
Sprite is inside fog or not, i will continue to work on this;

http://gigatron3k.free.fr/html5/C2/FX/fog2
http://gigatron3k.free.fr/Intro/

https://www.shadertoy.com/user/gigatron

https://twitter.com/realistquantum

Ezekiel 1-4 ; ufo landing explanation ..

CONSTRUCT 2 THE ONLY FAST WAY TO HTML5

Image
B
57
S
20
G
29
Posts: 804
Reputation: 21,969

Next

Return to Effects

Who is online

Users browsing this forum: No registered users and 0 guests