i am so glad threejs is still seeing use, my personal favorite js lib
ThreeJS has never been more popular with +3M downloads / week just prior to the holiday break: https://www.npmjs.com/package/three
Cigarette smoke effect using shaders
21–27 of 27 posts
Re: Cigarette smoke effect using shaders
#22In a game this is likely done as simply a prerendered animated texture (atlas). Perhaps in a modern AAA game you might try a GPU particle system with 10k+ particles.
Re: Cigarette smoke effect using shaders
#23Re: Cigarette smoke effect using shaders
#24A bit pedantic but that is a pipe smoke effect not a cigarette effect. Cigarette smoke tends to go horizontal for a ways before kinda going vertical. It works well in the image they use to demo it but the image shows a pipe where it actually looks right.
I'm not sure you can say one behaves one way and the other not, surely depends on lots of variables. As an anecdote, I'm literally sitting with a lit cigarette in my hand right now, and the little smoke that comes from the cigarette itself, goes straight up.
How does it feel to be living my dream rn...
Re: Cigarette smoke effect using shaders
#25awww, cool effect but I was half hoping for fluid dynamics simulation of the smoke with a lorenz fractal. What I've done is render the "smoke" to a framebuffer then apply some velocity to create some small vorticities.
Interesting point about the fluid dynamics! I’ve always been fascinated by how we can use math and physics to create visuals that feel so alive. A couple years back, I tried to replicate smoke effects in a game and ended up getting lost in fluid simulations—it’s wild how a few equations can lead to such organic results. But I wonder if there's a way to combine both approaches? Like using smooth gradients for the base…
Ooooo… we have smoke like it’s a 1930s billiards bar.
Here’s a few examples that use some fluid dynamics to make “smoke”
https://play.huwroberts.dev/advection/
https://www.shadertoy.com/view/DsKyWm
https://ghostinthecode.net/2016/08/17/fire.html
For fire, the import part is the flame, not the spark. It’s the same methods as above. Everything eventually lands on a 2D texture where you blur or blend it with the scene.
For smoke ribbons this works really well in screen space. For big plumes like mushroom clouds or physical clouds not so much. For those, volumetric SDF is the way to go with rayleigh marching and some gradient of grey.
Anyway, happy coding and enjoy playing with the rules of reality!
Re: Cigarette smoke effect using shaders
#26—Property manager, currently renovating a decades-smoked unit — just absolutely disgusting (and the de-tar chemicals are harsh, while still requiring mechanical dislodging) — I've already suggested that a non-refundible $3,000 deposit become required, if nicotine indoors isn't outright-banned (I don't care about weed indoors — it doesn't leave behind yellow tar everywhere).
So glad that even after decades of minimal drug abuse, cigarettes were never one of my vices.
Re: Cigarette smoke effect using shaders
#27IYKYK (but only if you lived in Finland in the 1990s)