#### Archived

This topic is now archived and is closed to further replies.

# Fire Effect question??

This topic is 6083 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi guys: I have been playing with fire effect for a bit while now.I have read a lot tutorials and books about this topic but they didn''t clearify one confusing point. The fire logarithm most of them adopted is to average the surrounding pixels((up + left + right + down) / 4) of the pixel that is being calculated. Now, according to what they said, in order to ''cool'' the fire, we have to subtract a small amount of the value from that averaged value. I am quite doutful of doing that, because for the calculating-pixel, its up value is always 0(because the background is black), so the averaging value of its surroundings will finally get smaller. So, what is the point of subtracting a cooling factor???? Can anyone tell me why they do that? or if I have understood the logarithm wrong somewhere?? Thanks for any help!!!

##### Share on other sites
Does it look worse when you use the "cooling factor"? If so then don''t use it. I don''t really see what the issue is here. Try both ways, if one works better than the other then use it, otherwise flip a coin or something.

##### Share on other sites
I do believe you mean algorithm, not logarithm. A logarithm (did I spell that correctly?) is used for finding an unknown exponent.

There should be a certain amount subtracted to ''cool'' the fire. Just think - you start off with a black background, but as time advaces, that fire will keep creeping up further and further until the whole area where the fire is supposed to be is all fire! Just do a little experiment - comment out the piece of code that ''cools'' the fire.

Moe''s Site

##### Share on other sites
Well, I just want to make sure that I understood things right?

##### Share on other sites

Actually, i haven''t coded my own fire yet. What I am trying to do first is to understand how it works! So, if I understood things right, the first frame of the fire does not need cooling factor due to the reason I listed in the first post. However, for the second frame of the fire, the background is not all 0 anymore, instead, it has the value whatever the first frame does,right?is that the point of using cooling effect?

##### Share on other sites
the cooling factor is mean to be applied before you draw the frame and is designed to help regulate the fire and prevent it from filling the screen. while you are avg with a black pixel above, this is a feedback effect and during later frames the fire will get hotter and rise higher on the screen.

so in essence you dont need it if you keep the randomness of the fire at the bottom quite high and sparse. the more times the bottom is filled with pixels of high brightness will increase the height of the fire, and the overall brightness of the screen and begin the need for the cooling factor.

this was probably a bit of a ramble but you get the idea. use it only if you feel it looks nicer.

[edited by - a person on April 20, 2002 2:17:58 AM]

##### Share on other sites
Thanks alot guys!!

I have grasped the idea now!!!

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633725
• Total Posts
3013558
×