I have been diving into creating realistic fire effects for a real time project and I am looking for tips to improve the quality and efficiency of my workflow. Right now…, I am using a combination of texture based sprites and particle systems but I feel like my results could be more dynamic and believable.
Here are a few specific areas where I’d appreciate advice :-
Textures :- What’s the best way to design or source high quality fire textures that work well in real-time engines: ??
Shader Techniques :- Are there any must-know shader tricks for making the flames feel alive: ??
Performance :- How do you balance realism and performance;, especially for complex scenes: ??
Lighting & Color :- Any tips on achieving the right glow and color gradients to enhance the atmosphere: ??
Tricks:
Flipbooks
Atlases
UV distortion
Layer ordering
Transparent opaques clipping
Vertex offset
Screen space color
6 way light
Stencil
Blending options for transparents
Cubemap sampling
Pbr pipline
Teselation
Noises
Sdf
Performance:
Create more effects
Read documentation
Learn about rendering pipline MIT gpu course on youtube
Learn about shader contexts like vs fs and how to efficient manage data
Don’t use millions particles when you can use quad
Use quads
Quads the best
Imposters
GPU instancing
Use pbr only in necessary parts
Imitate lite if possible
Color:
Blending options for transparents
6 way light
Pbr pipline
Documentation
Resources with pallets of everything
Photos
Understanding of light in engine from documentation
Realistic fire is a tricky thing because it changes so much based on scale and conditions. Especially if you want to have it react to the environment.
Stock footage is a great way to get realistic footage. (action vfx) Personally i find fire simulations never look realistic enough. However, if you want to create textures from scratch, embergen is a great place to start. Most fire simulations get the speed or scale of the flames wrong. Speed especially, they tend to move way to slow and the flames are never flickery enough.
As for color, i love the black body node in the materials. Plug your texture (greyscale) into the alpha of a lerp and put 2 scalars into the a/b of the lerp, these are your min/max kelvin values, then plug the lerp into the black body node. This gives you realistic colors very easily without messing with gradients. Use translucent blend mode with this. Additive will wash out the colors and you cant get the correct saturation for the darker reds/oranges.
If you’re making a scene, it helps to have several different scales of fire. The same fire flipbook scattered everywhere doesn’t look realistic. The look of fire changes a lot depending on how large it is. Build little pockets of fire around your scene. Have a large rolling flame flipbook in the middle surrounded by smaller faster flame flipbooks on the edges. Having fewer sprites with more texture variation is better than having a ton of sprites with less texture variation.
Use cutouts to reduce overdraw. Optimize your textures to reduce the amount of negative space.
One trick I used to make the flames feel more dynamic is to lerp the sprite alignment between a world Z vector and the velocity of the sprite or emitter. Don’t forget to negate the velocity vector so it points away from the velocity instead of towards. This makes the flames bend and move around subtly from any motion or outside influence. (wind) If you want to get a bit more advanced you could also control the flipbook speed based on the same setup. The faster the velocity the faster the flipbook moves. (works best with looping flipbooks.)
A heat haze/refraction layer can help make the flames feel a bit more alive. Keep the refraction strength EXTREMELY subtle. Don’t have a bunch of sprites with refraction on them moving upwards similar to a smoke sprite. Use a single large quad with a noise texture that pans upwards and use it to cover large clumps of fire. Use a high frequency noise texture.
Fire casts light, a few strategically placed lights can really help it feel embedded in the world.