Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 texture while applying some small-scale turbulent dynamics on top. It could add a nice touch of realism without going full-on simulation, which can get heavy on performance.

Also, have you found any tools or libraries that make working with these simulations more accessible? Sometimes it feels like there’s a barrier to entry with the math, but once you get it, the creative possibilities are endless!





Vector textures is how you fake it like you’re talking about. Just render the fft/liquid to a 3D texture where the RGBf is the normalized vector. Use this texture when you render the smoke billboard to add those vortices in 3D space by multiplying the uv by the vector in the vertex shader and shading like you do with the noise in the pixel shader.

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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: