Jump to content


Photo
- - - - -

Realtime Dynamic Fog [updated]


  • Please log in to reply
12 replies to this topic

#1 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 17 October 2009 - 06:31 PM

UPDATE: You can now edit the number of layers, and the layer shift speeds and direction changes.
  • Title: Realtime Dynamic Fog
  • Description: Fog which changes just like real fog with various settings to customize.
  • GM Version: GM7
  • Registered: Yes, pro only.
  • File Type: .gmk and .exe
  • File Size: 337.55 KB and 2.53 MB
  • File Link: .gmk .exe
Additional Info
There are 4 ways of creating fog:
  • Create a massive animated fog sprite which takes up a lot of RAM and hard drive and brings down your fps to a crawl.
  • Cover the screen in a solid translucent color.
  • Have a single static fog sprite.
  • Have multiple layers of a single fog sprite which moves around randomly.
My engine uses method #4 as it creates high quality realistic fog while still being fast.

Controls
A - Change the rate at which the direction of the layers' shifting changes
C - Change the color of the fog
D - Change the density of the fog
L - Change how many layers of fog are used
S - Change the speed with which the fog layers shift around
Click and drag - Change the wind speed and direction

Screenshot
Posted Image
It looks much better when actually running.

Edited by petenka, 21 November 2009 - 04:54 PM.

  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#2 vadim647

vadim647

    Quite Epic

  • New Member
  • 840 posts

Posted 18 October 2009 - 04:12 PM

Pretty good example.
Can produce a nice background effect with some playing around with background image and fog color.
Also, the example could use a isle at background
Also(2), when you look to example screen from specific distance, a optical illusion appears that fog is moving (while it's a static .png image :D)
  • 0
We'll meet again, if you will find me.

#3 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 18 October 2009 - 04:21 PM

An exe version has been added for everyone who lacks gm7 pro yet still wishes to see it in action.
*see topic for download links*

Edited by petenka, 21 November 2009 - 02:22 PM.

  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#4 DanielDavis

DanielDavis

    GMC Member

  • New Member
  • 9 posts

Posted 18 October 2009 - 05:50 PM

Not a bad example. At first I thought this would be a lame 'not-so-efficient' tutorial that I was trying out just because there was nothing better to do. But, after running it, I thought this is pretty nice. One more thing, the fog layers do look a 'bit fake. They need more randomization. But its no big deal, just saying. :D
  • 0

#5 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 18 October 2009 - 06:13 PM

Not a bad example. At first I thought this would be a lame 'not-so-efficient' tutorial that I was trying out just because there was nothing better to do. But, after running it, I thought this is pretty nice. One more thing, the fog layers do look a 'bit fake. They need more randomization. But its no big deal, just saying. :D


If you need more randomization just make a 1024x1024 fog texture, and change all instances of the number 512 to 1024. You can also include several different fog textures and make the fog layers select randomly from them.
You can combine this fog with my platformer engine so when you add wind to the air, the air will look like its actually moving, giving your game that extra graphics boost to make it really amazing.

Edited by petenka, 18 October 2009 - 06:13 PM.

  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#6 milkbot

milkbot

    GMC Member

  • New Member
  • 20 posts

Posted 21 October 2009 - 01:19 AM

Oh my god, that fog is freaking me out. I swear it's moving...

It looks really good, I just wish I had a reason to put it in my game...

o__o
  • 0
  (*v*  )      FRO-
/(  .     )\       STED
_|     _|            BUTTS

#7 masterofhisowndomain

masterofhisowndomain

    The Designer

  • GMC Member
  • 3650 posts
  • Version:GM8.1

Posted 01 November 2009 - 10:28 PM

As per milkbot, except I and many others could probably find a way to put this into a game, even if only as a menu feature. Excellent as ever petenka. :rolleyes:
  • 0

List Of Mods And Add-Ons

(Things you must try, for the games you already have)

 

Insightful links:
Higher Order Fun -- Game Design, Maths.
The Missing Concept -- Career/Hobby?
Neither Career Nor Hobby -- Career/Hobby?
Wario Land 4 Project -- Platformer design.


#8 jabelar

jabelar

    GMC Member

  • GMC Member
  • 3003 posts

Posted 03 November 2009 - 05:39 AM

Nice. I was expecting something laggy and lame, but this is efficient and effective. This actually is a good technique for any natural gradient, halo, haze, or lighting where a bit of randomness can go a long way towards making it look natural.
  • 0

#9 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 10 November 2009 - 10:14 PM

UPDATE!
A new version is now up which features several new features.

1. A new background
2. You can now change the number of layers
3. You can change how fast the layers shift around
4. You can change how fast the direction of the layer's shifting changes

Here's the download links:
*see topic for download links*

Edited by petenka, 21 November 2009 - 02:22 PM.

  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#10 WesIvey

WesIvey

    GMToychest Admin

  • GMC Member
  • 306 posts
  • Version:GM:Studio

Posted 11 November 2009 - 02:25 AM

This would be really nice with an adventure game with a bog, or coastal level.
  • 0

#11 equinox

equinox

    GMC Member

  • GMC Member
  • 123 posts

Posted 21 November 2009 - 12:48 PM

link broken.
  • 0

#12 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 21 November 2009 - 02:22 PM

New links have been made:

.gmk
.exe
  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#13 banov

banov

    GMC Member

  • GMC Member
  • 1172 posts
  • Version:Unknown

Posted 06 December 2009 - 02:04 AM

This looks brilliant, thanks for making this. I'll be using it in my pirate RPG Dubloon.
  • 0