• Welcome to Dark Bit Factory & Gravity.
 

Improving the basic fire effect

Started by rain_storm, November 13, 2012

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

rain_storm

Basic fire effect as seen at Lodes Site
Produces effects such as the attached exe.

Now I have 64 bytes spare after this basic effect is in place and would like to make use of those bytes by improving the visuals. What options are available, How would I go about adding a coolmap for example?

Challenge Trophies Won:

rain_storm

I found a good tutorial by HugoElias. The cool map alone wasn't enough to make it look good though. I had to play around with the pallet. This pallet worked best


for (int colour = 0; colour < 256; colour++) {
    Blue  = 0
    Green = min(2*colour, 255)
    Red   = min(4*colour, 255)
}


Here is the final release
http://www.pouet.net/prod.php?which=60743

Challenge Trophies Won:

Hotshot

It ran Super Fast and Smooth on My Laptop :)

Good Fire Effect there  :)

Tronix

Quote from: rain_storm on November 14, 2012
I found a good tutorial by HugoElias.

Many times i did fire effect, but never used "Cooling map". I think it is a very good idea.
BTW: i prefer this palette:
    for (c=0;c<=25;c++) { // black to red
        r[c]=(c*10);
        g[c]=0;
        b[c]=0;
    }
    for (c=26;c<=85;c++) { // red to yellow
        r[c]=255;
        g[c]=((c-25)*420) / 100;
        b[c]=0;
    }
    for (c=86;c<=141;c++) { // yellow to white
        r[c]=255;
        g[c]=255;
        b[c]=((c-86)*451) / 100;
    }
    for (c=142;c<255;c++) { // and then white only
        r[c]=255;
        g[c]=255;
        b[c]=255;
    }

rain_storm

That is nice, You have more white in that pallet then the one I posted. The advantage of the one I posted is the size of the pallet generator. Two shifts (or adds) and two conditional moves. But of course such a simple generator is not going to output the best quality pallet.

The cool map is great for simulating convection. One thing that was mentioned by Hugo was that the cool map should be scrolled vertically at the same speed that the flames rise (one pixel per frame). I didn't implement this yet but he says that you can get nice tounges in the flames using this method.

Also his method for gathering heat is to take the pixels surrounding the current pixel and average
x-1, y
x+1, y
x, y-1
x, y+1

    +---+
    |   |
+---+---+---+
|   | X |   |
+---+---+---+
    |   |
    +---+


While in lodes version all of the heat is gathered from below the current pixel like this
x-1, y+1
x, y+1
x+1, y+1
x, y+2

    +---+
    | X |
+---+---+---+
|   |   |   |
+---+---+---+
    |   |
    +---+


With Hugos method heat will spread in any direction, while in Lodes method heat only rises.

Challenge Trophies Won:

flightcrank

I implemented the HugoElias tutorial and came away with some really cool looking fire ! its the cooling map addition that really makes this effect look good.
Challenge Trophies Won:

spitfire

awesome, i still love this effect.

Isn't it interesting that the same basic blur box algorithm is at the heart of both the fire and the water ripple effect? Now we just need an earth and wind blur effect to have all the elements :)