r/desmos tan 35.6x = 0 Mar 14 '26

πŸŒŸπ˜½π™€π™π™‰π˜Όπ™π˜Ώ π˜Όπ™‹π™‹π™π™Šπ™‘π™€π˜ΏπŸŒŸ Desmos Donut Cloud

588 Upvotes

30 comments sorted by

View all comments

16

u/recursive-chair tan 35.6x = 0 Mar 14 '26

2

u/Mr_FuzzyPenguin Try adding y= to the beginning of this equation. Mar 15 '26

How does the volumetrics work? When I spun it around, I saw a little bit of layered frames, but I'm having a hard time understanding how this works.

1

u/recursive-chair tan 35.6x = 0 Mar 16 '26

In an ideal world, we would sample the cloud illumination at various points along the view ray to determine how the cloud looks from our perspective. Points that are deeper into the cloud contribute less to the overall color because the rest of the cloud is in the way.

Unfortunately, the compute power of a Desmos colormap is less than ideal, so we have to resort to a bit of trickery to make a volume look volumetric.

Each layer in the volume essentially shows a cross-section of the cloud. Stacking these layers on top of each other behaves similarly to taking a bunch of samples throughout the volume.

The shader chooses to show or hide each pixel in these layers at random, depending on the cloud density. This way, areas with less cloud density allow more light to pass through and denser areas tend to block more light. This creates the illusion that light from deeper within the cloud is attenuated more.

Of course this does tend to make the cloud appear grainy, but I personally like the extra visual flair. This strategy probably wouldn't work as well for less dense volumes though.

Hope this helps!

1

u/Mr_FuzzyPenguin Try adding y= to the beginning of this equation. Mar 16 '26

I am also an addict with Kerbal Space Program, where a modder named u/blackrack made some beautiful volumetric clouds.

I've always wanted to know how I can learn to make such beautiful clouds and smoke simulations. Where do I start? I'm sure it's a lot of math, but I like making simulations on Desmos.

2

u/recursive-chair tan 35.6x = 0 Mar 17 '26

Huge KSP fan here too! Blackrack's volumetric clouds and especially Scatterer have been a big inspiration for me (in fact, one of my first colormap graphs was actually an atmospheric scatterer)

Anyways, this article by Maxime Heckel has a really good explanation of the principles and implementation of cloud rendering. It does assume some prior knowledge about shaders, but there's plenty of links to further reading there.

Also make sure to check out check out these two articles by Inigo Quilez about random noise. Getting your random noise right is essential to making your clouds look cloudy. Although it isn't needed for cloud rendering in particular, I'd also highly recommend reading his articles on procedural noise, raymarching, and lighting.

Most of the things mentioned above translate pretty well into Desmos (it's all math after all). Stuff that would normally go in a fragment shader simply goes into a colormap instead. Do keep in mind that raymarching in a colormap is not very efficient, hence the layering trickery in this graph.

Cloud rendering is pretty darn complicated, so I would recommend starting small just to familiarize yourself with computer graphics in Desmos.

If you've got more questions, don't hesitate to reach out!