smcameron / curly-vortex

Faking computational fluid dynamics a la Bridson-Hourihan-Nordenstam's paper "Curl-Noise for Procedural Fluid Flow" See also: gaseous-giganticus: https://smcameron.github.io/space-nerds-in-space/gaseous-giganticus-slides/slideshow.html#1
GNU General Public License v2.0
33 stars 2 forks source link

cyclones #3

Open nicosalto opened 8 years ago

nicosalto commented 8 years ago

Hi, I have to say this code is really cool and that's great that you are sharing it! Its really helpful to what iam trying to achieve. Iam trying to create a planet of storms, meaning the planets is covered with storms and the clouds are moving different streams. Iam going in the right direction with your code but iam missing a part. I need to great big Cyclones that are occupying a big part of the planet. This is the look iam going for : http://la.climatologie.free.fr/cyclone/cyclone-ivan.jpg

Do you have an idea of what kind of algorithm i can use to create this and how i could integrate if with your curly Noise ? To me its important to marry both as it give this organic look.

smcameron commented 8 years ago

Well, if you can create a velocity field that makes a hurricane like that you should be able to superimpose it into the velocity field within curly vortex. The main thing to watch out for is that your hurricane velocity field should ideally have no sources or sinks. If that condition is not satisfied, then things will disappear into the sinks, and bare spots at the sources.

The other thing is if you're looking for white clouds and distinguishing between clouds and ground (as opposed to 100% clouds) then it get harder. One approach is to have the white clouds and also transparent portions. With that approach, and some other ideas, I have gotten results like this:

http://imgur.com/dYSyyVX http://imgur.com/oVnKnzq http://i.imgur.com/nKeDFrc.jpg <--- running swirliness algorithm too long http://smcameron.imgur.com/all/

Is your use case 2D or 3D? If 3D, you may be interested in a couple presentations I have: http://smcameron.github.io/space-nerds-in-space/gaseous-giganticus-slides/slideshow.html#1 (use arrow keys to navigate -- probably doesn't work well on mobile.)

https://smcameron.github.io/space-nerds-in-space/earthlike/example/slideshow.html#1 (again arrow keys to navigate, probably doesn't work on mobile)

There's also this, which may be of interest: https://github.com/smcameron/space-nerds-in-space/blob/master/howto-generate-earthlike-planets.txt which describes how to generate earthlike planet textures with clouds for my game Space Nerds In Space.

There has been some recent work to adapt the technique of using curl noise on a sphere to work on the GPU (not by me) described here: https://www.junkship.net/News/2016/06/09/jupiter-jazz

Another thought... I did ad some vortices into gaseous-giganticus with this commit: https://github.com/smcameron/space-nerds-in-space/commit/22b3701ffa613c4a2d8a5ac975ede1588be3edd8

You can see an example here: http://imgur.com/RjHS1z1

Not exactly what you're going for, as the vortices are more circular like on Jupiter, not like earth style hurricanes, but you can see the technique of superimposing a vortex on an existing velocity field (though a little more complicated because it's in 3d on a sphere instead of in 2D).

Hope that is some help.

smcameron commented 8 years ago

BTW, I should add, if you're looking at the curlyvortexcubemap code -- I never really got the cubemap one to work right -- always discontinuities at the face boundaries -- I ended up doing it properly in 3D in C, in gaseous-giganticus.c over in my space-nerds-in-space repo.

nicosalto commented 8 years ago

Thanks a lot for the complete answer. Iam not looking for generating the ground floor actually, my idea is just to generate an animated cloud map and then take it to a 3d software such as maya to render a planet with Photoshop planets texture for the base planet layer. The cloud map will be used to create volume clouds. You are referring to the code in space nerds in space which seem to be a more advanced version of this code ? I guess the vortices code is the way to start for me, i just need to implement it in processing as i want to work with this package to develop the look.

smcameron commented 8 years ago

I see. With a 2D solution, you may find some problems mapping onto a sphere, most typically, distortion at and near the poles. Perhaps you can live with the distortion, or avoid it by making your storms avoid the poles, mitigating by pre-distorting the 2D map to compensate, etc. For my application, the distortion was undesirable, so I ended up doing a proper 3D implementation, which is gaseous-giganticus.c in the space nerds in space codebase.

Generating realistic looking clouds is tough. The way I am doing it is cheating -- I take some cloud imagery from NASA over the pacific, slam it to grayscale, boost the contrast, esp. smashing the darks to black, treat the intensity as opacity, then sample this data in the same way as I sample the heightmap data in the "earth like planets" presentation I linked previously to spray some cloud samples onto a sphere. Then, I take that cloud cubemap and run it through gaseous giganticus a bit to make it a bit more swirly. That's the best thing I've been able to come up with so far, but it still feels like cheating to sample NASA cloud photos.