Using Easy Cloud as mask to determine where rain falls out

Started by tws27, December 05, 2020, 11:05:24 PM

Previous topic - Next topic

tws27

Hi all, this is a question which largely follows on from the "stormy sky" thread at https://planetside.co.uk/forums/index.php/topic,23592.0.html  I have been using Terragen for several years but only purchased the registered (Creative) version earlier this year and have been using it mainly to make skies.  My knowledge of how to use Terragen is patchy, strong in some areas but weak in others.

Using Easy Clouds I have been able to create realistic-looking cumulus congestus clouds using the Altocumulus Castellanus and Cumulus presets, by setting the "Cloud depth" to around 50000.  I have also been able to simulate "rain" quite well by manually placing a localised Y-stretched "Global: Very Thin" cloud with custom settings along the lines of Edge Sharpness 0.16, Cloud Density 0.016 and Coverage 1 underneath a given cloud.  I've attached one of the better examples of this effect as an image.  The default colour of 0.25 works well for rain showers, and if I want to simulate snow or hail I simply increase the cloud and scattering colours (0.6-0.7 seems to work well for snow).  However, it's a bit cumbersome manually matching it to sit underneath the thicker clouds.

In that aforementioned thread, Dune posted the following:

QuoteThe rain can be done with a stretched masked cloud at lower altitude, which is also warpable (for wind effects). You could even use the main cloud as mask to determine where the darkest clouds need to rain out.
So I've been looking into creating a Y-shaped thin global cloud ("Shower 01" in the attached nodes diagram), with the same size and position (again localised) as the main zone of clouds (here "Ac Cas 01") and seeing if I can achieve this.  Despite several hours of experimenting and checking the various forum threads relating to rain, I'm stumped as to how to achieve this.  


I got a good starting point here by seeing that if I mask "Ac Cas 01" by a Distribution Shader v4 (again as per the attached nodes) and limit the minimum altitude to 5000, it displays only the thickest parts of the cloud, corresponding to the parts of the cloud that I wish to see "rain out".  

But what I'm ideally after is to mask the "Shower 01" cloud (the Y-stretched thin cloud that represents the rain shafts) by the thicker parts of "Ac Cas 01" so that as per Dune's earlier suggestion the cloud appears in full, but it only "rains out" underneath the thicker parts.  It's mainly with the idea of creating a more "automated" system of creating rain.  As I've tried all sorts of combinations but whatever I do, "Shower 01" comes out "all or nothing", rather than being masked by the thicker parts of "Ac Cas 01".  Has anyone any ideas and is this indeed even possible?

Dune

Welcome to the forum first of all. Then a slight disappointment, as masking from an easy cloud is not possible, afaik. The method for rain from a thick part of a cloud comes down to adjusting the fractal from the cloud so you have the thickest part, but then stretching it in Y, so it not only covers the cloud altitudes, but 'reaches' down as well. And from an easy cloud there's no way to stretch the fractal, as it's hidden inside. There might be a way, but I don't know.
You could however try using the same settings of the easy cloud (altitudes and fractal seed) and make a generic v3 or v2 cloud. You'd have to experiment if the fractal is perlin, billow, or whatever, and see if you can match the easy cloud first. If so, you can use that (just that, but stretched) fractal as a mask.
Theoretically!

I hope this helps a bit.

tws27

Thanks for this, I think my original setup was unworkable from that point of view as I had an easy cloud with animation and drift enabled, which makes it very difficult to match a v3 or v2 cloud's density fractal to it (4D noise isn't quite the same thing).  But setting an easy cloud to drift across the sky by altering the X/Y positions with each frame and then setting a v3 cloud with the same X/Y positions and with a density fractal with the same seed seems to get reasonably close to what I was after.  It's still going to require some experimentation with settings but I am certainly getting closer.

Edit: I have been running into other problems using that method (clouds appearing distorted when in some frames they are centred a long way away from the camera, etc.)   I might just have to settle for my original setup but using the distribution shader mask to highlight the areas to put the rain showers, which is at least better than second-guessing where the clouds are thickest.  But I've learnt a fair bit from sharing this, so thanks for the help.

WAS

Been noticing this too. Clouds far away from the camera look really bad. And if they are masked, they get very blobular and simple at a distance making weird round Perlin cut-outs seemingly stretched on Y. Can't figure what is causing it.

Matt

You should be able to render an overhead image of the clouds and use that as a texture. You load that into an Image Map Shader and use camera projection to reproject it into the scene using exactly the same camera that you used to export the clouds.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Quote from: Matt on December 09, 2020, 09:36:29 PMYou should be able to render an overhead image of the clouds and use that as a texture. You load that into an Image Map Shader and use camera projection to reproject it into the scene using exactly the same camera that you used to export the clouds.

That's smart, wouldn't have thought of that immediately. Going to try this, as I often like the easy clouds for those low level thick cumulus looks.

Dune

QuoteIt's mainly with the idea of creating a more "automated" system of creating rain.
This is the only problem then.