fire blowing dragon - please help

12 September 2018 01:39
dear all,
is there a simple way to simulate the fire+smoke blown by a dragon? It seems to me (I'm a newbie) that this is only possible by means of blender render and cycles, but not in b4w. Am I right?

12 September 2018 20:48
No, you can do this with B4W easily. And I love fire effects! So here's a quick demo dragon. Click on it and it will spit a huge burst of flames and ridiculously large plumes of smoke. The dragon model was made by alimayo from BlendSwap who did a great job!

Demonstration: LINK
Download: (attached to this post)

I think I'll tweak this some more. This is just too much fun!
12 September 2018 23:45
Blend4life, thank you for the response. Now I know that it can be done, but i don't know how

The demonstration is ok, but animations are lacking in the dragon model by alimayo. I have found lots of fire animations in blender, but none working in blend4web…

Can you further help me?

13 September 2018 18:20
Can you further help me?

to do this, you need to use particles, approximately as in this example
13 September 2018 18:24
I've attached the to the original post, which also includes the .blend file. You can import this with the Project Manager too.

Now I know that it can be done, but i don't know how
Fire and smoke are done with emitter particle systems. Let me describe the scene:

Particle Systems:

A disc object serving as the emitter is put in the dragon's mouth. It contains two particle systems, one for the flames and one for the smoke. Each particle system needs a material for the particles with a .PNG image (for transparency), one with flames and one with smoke. The materials for the particle systems should be placed in the emitter object's material slots, so there are three materials there: "Fire Flames", "Fire Smoke", and "DNR" (do not render) for the emitter object itself (usually, you don't want it to be visible in the scene).

The particle systems are tuned with color ramp textures to influence the particles' size and color in flight. This is a very important feature to add more realism to the effect. It explains e.g. how a rising smoke column can be made to grow towards the top and how flames turn from white to orange as they rise.

Color: The flames go from white to orange as they spread out. The smoke is initially orange to simulate being illuminated by the flames and then fades out to dark gray. This looks especially good in nighttime scenes. The textures that control this are under the Textures -> Material tab: "fire_coloring" and "smoke_coloring".

Size: The flame particles start small, grow bigger and then shrink a bit. The smoke particles start small and then grow very large. The textures that control this are under the Textures -> Particle System tab: "fire flames size control" and "smoke blend".

Unfortunately, there are many more settings in the particle system you need to make, and fine-tuning them can be fiddly because they all somehow interrelate to give the overall effect:

Number: How many particles you want.
Normal+Random, Rotation+Random: How the particles move, and how fast. Allowing a "normal random" also helps to make the smoke appear to disperse at the top.
Start, End, Lifetime, Fade-In, Fade-Out, Soft Particles: These are all interrelated and control the evolution of each particle based on the Timeline. Particles of fire, smoke, water etc. should be "soft" to hide their edges, and "Billboarding" should be used to fake an appearance of volume from any view angle (when particles are actually flat planes).
Size: Initial size of the particles.
Gravity, Wind: Physics influence on the particles. Gravity is zero here so the dragon can spit a nice straight line of fire. (Only wimpy, weak-ass dragons would spit fire that curves down. ) There's a slight upward wind force to push up the smoke cloud.

All these settings are also described in the manual.

Rest of the Scene:

There's a little animation for the dragon (open mouth, close mouth). A simple Logic Tree controls the scene. The particle systems are set to "Allow NLA" which means you can use markers on the Timeline and then a "Play Timeline" Logic Node to start an emission cycle. In other words, particle systems can be managed like animations (although in many cases they are simply set to "cyclic" + "play default animation" and play automatically and infinitely, such as the volcano in "Island Flight").
13 September 2018 18:45
Further Reading:

The tutorial "Making a Game" describes in detail how its particle systems were made (falling lava rocks section).

Also: There are several B4W demos that feature fire and/or smoke:

* the Burning Huts demo ("Soft Particles")
* the lava world game ("Making a Game")
* Island Flight
* Pirate versus Alien

…and others. They all use particle systems and color ramps to control the particles, so this is how I learned to do it. Study these demos!

I have found lots of fire animations in blender, but none working in blend4web…
This is because Blender's physics/effects tools are mostly aimed at video production etc. where extensive calculation is required for every single frame, not so much at real-time engines like B4W. (You know, that funny moment in Youtube tutorial videos when they say, "okay, let's bake this…" and then cut out the four hours it took to render a three second sequence.)
13 September 2018 22:20
Thank you, you're a master. Everything is clear, now. A hug.
13 September 2018 22:59
you're a master
Hah! No, I'm just using the stuff others did before me. True master:

Also good for learning how actual flame throwing looks like.

Everything is clear, now. A hug.
Yeah, but you've got to return with a link to your dragon project when it's done. We wanna see!
Please register or log in to leave a reply.