Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Animating fire texture

Author
Message
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 28th Jun 2012 17:59 Edited at: 28th Jun 2012 18:00
Does anyone have, or know where to get, a good animating fire texture from? By animating, I mean arranged as a texture atlas (1 texture), preferably with 64 frames. e.g.



I've spent ages googling for threads, google images and has a look on CG Textures and TurboSquid. There isn't anything! Either the fire textures are rubbish, or they don't loop, or they don't have an alpha channel (which makes them useless really). I even looked at ExGen sold on the TGC site, but that doesn't export an alpha channel either.

Anyone have any suggestions? At the moment the only real option seems to be to buy an expensive particle editor package, but my wallet won't stretch to a 3 figure price tag.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 28th Jun 2012 18:27 Edited at: 28th Jun 2012 18:32
Can't answer your question directly so I'll suggest a different approach.

You don't need alpha channel for fire textures. These things are done by applying Ghost Object On. It will allow multiple textured plains to blend together nicely and create realistic fire effect. I've been modding quite a few games and never seen a fire texture with alpha channel so far.

Here's an old game I did in 2005 it uses ghosted planes without alpha:


Ignore the spelling

A game I modded back in the days Kingpin: Life of Crime (1999) uses similar technique.




Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 28th Jun 2012 19:36 Edited at: 28th Jun 2012 19:36
Hi Olby. Additive blending does work pretty well for fire, but you get different levels of intensity depending on the background. e.g. if it's over a pitch black background, it'll be the brightness of the image. If it's over a full white background, it'll be full white and the flame will be invisible. At least, that's how I remember ghosting working. Plus, if there is a smoke element to the animation/flame, then that may need to be darker than the blackground, but you'll always get a very light grey.

With an alpha channel, you can display it with a consistent brightness for all background surfaces. If you want the super brightness that additive blending provides, you can use a shader or probably other commands like the fade object command.

As it turns out, Particle Illusion 3 has a trial which I'm currently playing around with. Good effects! It outputs the images with alpha which is great. Only problem is, I have to copy and paste 64 individual images into a larger texture map. Bring on approximately and hour of copy, click, paste, repeat.

I almost started writing a DBP program to create texture atlases for individual files, but then realised you can't save with transparency in a format I can open (DDS probably saves the alpha but I can't open them). So canned that idea!

Here's an export from PE. There was a built in campfire preset which I just tweaked a lot. It doesn't export looped animations, so I'll have to do that myself.



Attachments

Login to view attachments
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 29th Jun 2012 00:29
Quote: "but you get different levels of intensity depending on the background. e.g. if it's over a pitch black background, it'll be the brightness of the image. If it's over a full white background, it'll be full white and the flame will be invisible."


Not to argue with you, but have you seen a flame from a lighter against greyish skies? It's pretty invisible to me.

To make it even more realistic I suggest you paste various coloured planes (additive or alpha) along the trajectory of flame. For example sprites closer to the flame-thrower are usually brighter almost white while the distant sprites are somewhat darker/orange. It takes a great deal to make it realistic and to date I have seen only handful of games where the flame is really convincing.

Particle Illusion looks cool, but it seems that it is more video post process oriented.


Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jun 2012 05:32 Edited at: 29th Jun 2012 05:33
hmm, to add an alpha channel you can use the gimp. It is only 2 or 3 klicks and your above picture looks like this.


To make a textureatlas i use XnView. i use the german version and there is a function called 'Bilder aneinanderreihen ...' in the menu 'Erstellen'. In English maybe 'Create' -> 'Arrange images ...'??? It has a short cut 'shift + A'

I hope this can help you

With Computers you can solve Problems that you have never befor.
Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th Jun 2012 10:31 Edited at: 29th Jun 2012 10:32
Quote: "Not to argue with you, but have you seen a flame from a lighter against greyish skies? It's pretty invisible to me."


That's true. I think that's due to the flame intensity though. I think the strength of the light coming from the sky is stronger than that of the lighter. Here's a pic of a clearly visible flame against a light sky. I think this is visible because the intensity of light is very strong, as well particles in the flame itself are very dense. That's just my guess, as I'm not a physicist!



Quote: "To make it even more realistic I suggest you paste various coloured planes (additive or alpha) along the trajectory of flame. For example sprites closer to the flame-thrower are usually brighter almost white while the distant sprites are somewhat darker/orange. It takes a great deal to make it realistic and to date I have seen only handful of games where the flame is really convincing."


Yeah, flames are like running water or blood etc. They're just too complex to simulate well, so it's all one big fake, and it's tough to get it right. I'm fairly happy with the flame-thrower now. My approach is similar to yours, as I have an animation on the particles which blends from a light yellow to a cooler orange/red. This animation is for small residual fires and things that are burning though. Since there will be lots of them, it needs to be a low hitter performance wise, so the animation is key. Think I've cracked it with P.E. though.

@MadBit - Thanks for those links! They're cool sounding apps. If XnView can make texture atlases with that arrange function, that'll save a lot of time and effort in the future. I'm going to check them out at lunch. Nice one.

Btw, here's my final PE image for anyone that may find it useful and search for this thread in the future. It's only 32 frames, as I'm saving the bottom portion of the texture for another animation, but it looks pretty good. It has a full alpha channel and I've made it loop.



Attachments

Login to view attachments
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 29th Jun 2012 12:28
Yes, Gimp and Xnview are great apps and better yet they're free. Haven't touched a commercial graphics package in years.

@Fallout: I see there's some clipping on some of the frames. But non the less looks great.


Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Jun 2012 12:44 Edited at: 29th Jun 2012 12:45
You could use a shader to do the animation.

Here's an old fire effect demo of mine (three variations on a theme in fact). It was one of my early shader attempts so can probably be improved - and, as Olby says, it's easy to get the alpha blending right when you use a shader.

I can develop it a bit if you think it would be useful.

Edit Forgot the attachment.

Attachments

Login to view attachments
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Jun 2012 12:52
Mind you Fallout's flame-thrower looks so good, I wouldn't bother touching it, and get on with something else.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th Jun 2012 13:12 Edited at: 29th Jun 2012 13:13
@Olby - Yeah, I noticed that once I saw it attached to the post. Luckily it isn't visible in game, so I should get away with it.

@Green - That's a good effect chap! It looks fairly lightweight too, which is cool. It's interesting too because obviously you need much less texture memory, but then there's the GPU performance overhead (the GPU is already rammed with other shaders).

If I find my need for fire effects goes beyond the simple little flames I have dotted about, I may have a play around with this approach. Thanks buddy.

@Pincho - Thanks mate. This effect is for residual fires, such as on wooden crates, or areas where the flame thrower touches. I think I'm leaving the flame thrower as it is.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Jun 2012 13:15
Quote: "Mind you Fallout's flame-thrower looks so good"


Where can we find this?
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th Jun 2012 13:16


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Jun 2012 13:21
Thanks.

That is indeed very good.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Jun 2012 14:07
Looks great!

In DBPro, if you want to make an atlas program, I'm sure you can set the bitmap format to 21...

SET BITMAP FORMAT 21

And then bitmaps support alpha, cls them, paste on the image, grab the resulting image and save as .PNG.

I tend to go with flame particles for this stuff, but that does look neat - it's a nightmare finding good quality effects sometimes, will have to check out that particle generator.

Health, Ammo, and bacon and eggs!
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 29th Jun 2012 19:13
Wow this fire flame looks amazing.

Login to post a reply

Server time is: 2024-09-12 00:42:08
Your offset time is: 2024-09-12 00:42:08