Hacker News new | past | comments | ask | show | jobs | submit login

Fluid mechanics guy here. Let me first say this looks really nice overall!

The part that has probably highest potential for improvement is the sharpening, the artifacts there look a bit weird still.

Physically speaking, what you see on Jupiter (and on a river) is an interfacial flow. There is a divergence-free bulk flow underneath, but the interfacial flow itself has a lot of divergence. Upwellings have positive divergence and supply fresh stuff (colour!), downdrafts have negative divergence and consume stuff/colour.

But wait! You are using curl noise for your vector field! Of course the divergence is then zero everywhere!

If you take just the gradient of the scalar noise field you use for your curl noise, this will have lots of divergence and "compatible shape". Just scale this down a bit and mix with your curl noise.

And then finally take the value of your scalar noise field, scale it to be symmetric around zero, and use this to determine how much color to add/remove.

I think this will remove your need for sharpening entirely.

Disclaimer: this is just top-of-my-head while walking home.




Really great observations - thank you! I already use the method you described - curl is mixed with some amount of gradient to artificially bring color from the bottom layers. It can be observed at the center of the red cyclone in the last YT clip. Keep in mind - i wasn't going for true fluid mechanics - I just used some of the flow patterns observed in real fluids and layered them on top of each other to give the illusion of a more complex behavior. As for the sharpening - it is used to counteract the blurring effect of interpolating the color texture every frame.




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

Search: