## Cloud Altitude and Density

Started by WAS, October 22, 2019, 05:45:52 PM

#### WAS

Quote from: Tangled-Universe on November 18, 2019, 06:35:06 AMThat's an insane cloud, really cool!
What's the cloud altitude and depth in this case?
I see stepping goes all the way up to 20km altitude. While such extremes do exist it's usually up to around 12km.

I guess render time is pretty long for such a large depth cloud layer?
(Can't wait until the new threadrippers are released next week!)
Quote from: Hetzen on October 29, 2019, 03:07:48 PMStep Start sets the black point, Step End sets the white point, is another way of looking at it. It's similar to how a Colour Adjust works when working with its black or white points in the Input Levels tab. If you move the black slider past the white, you'll see a similar 'flip'.

Colour adjusts are my preferred nodes to perform these kind of selections.
Besides using PF's as input for smooth steps is there any other reason why I should go for smooth step scalars instead of colour adjust?
I like it that it's doing the job with just 1 node.

@WAS Perhaps you already know, but it might still be valuable for others to know... Be aware that "get altitude" are world space values and "get altitude in texture" are specific for the element the node network eventually ends up, in this case a cloud.
So if you have a cloud layer at 1000m altitude and 2000m depth (base = 0 meters and top = 2000 meters) then when using similar smooth step scalars the results are different between get altitude and get altitude in texture.
Assume step start = 0
Assumte step end = 2000
If input = get altitude --> output is smooth gradient from 0 to 2000 meters in world space.
If input = get altitude in texture ---> output is smooth gradient from cloud altitude to cloud altitude + 2000 meters, because the cloud's principle altitude of 1000m = 0 meters in texture space.
To match the "get altitude" result you'd need to set step start to -1000 and step end to 1000.

In turn this depends on whether you use the checkbox to keep textures when moving clouds.
So before setting up any cloud work think ahead of what you intend to do with the cloud layer and (un)check the "keep texture when moving clouds" box or whatever it's called.
This assures that should you decide to make your cloud movable that you don't have to recalculate and retransform your whole network, also for altitude.
Personally I prefer to work this way by default.

Thanks for the additional information. I did know this. One thing to keep in mind is texture space altitude keys do not relate to altitude heights.

Also great work RogueNZ, it seems you got the idea of what I wanted from the discussion or just had the same ideas.

#### RogueNZ

#16
Good info there TU.

Cloud depth I believe was 20km, base altitude 500m. Render time was surprisingly quick, about 17mins I believe on the 3900x. AA6 and MPD of 0.5, 100million voxels and no cloud acceleration. Everything else was default I believe.

I still struggle to understand how the Cloud Depth Modulator can be used exclusively to create 3D shapes like this - I understand how density can work (in a 3D space), but in my mind a depth modulator should act like a 2D height map. It clearly doesn't, I must need to think about it some more.

Plugging that branch into Density produces a similar result, but not exactly the same.

This image shows the shapes I would like to create eventually. At the moment I am using three ellipses to drive the shape. In the drawing I'm visualizing how I imagine using these shapes (red) to mask the Power Fractal (grey) should work. I expect I should be seeing flat edges where the mask cuts off the PF. But I don't in my render?

Edit: maybe the edge fall off on the shapes blends the hard edges away? Will test when I get home.
brendangully.co.nz     |     artstation.com/roguenz

#### Hetzen

Good to see you guys working with this setup.

RogueNZ, those profile shapes are possible. One way would be to warp the position of a simple shape shader that has a soft edge using a Get Altitude to determine how it shifts along X or Z through Y. And apply 3 variants with TGD I posted.

You would also need to shift the black and white points of that mask to give you the tapered profile. Colour Adjust does shift black and white points, but it does so statically, ie it doesn't change once set.

So looking at the base of your shape, lets say we have a circular SSS with a radius of 1000m with a Linear edge thickness of 1000m. This node will have a pure white spot in the centre and pure black at its edge, with a linear greyscale ramp from edge to centre.

What you can then do is use a Linear Step node to shift where black and white is within that circles ramp. Just as you can with a Colour Adjust shader. The difference being is the scalar inputs can be adjusted with further functions.

In this example you could use one Linear Step with Get Altitude as its input to create a black point at 0m altitude and white at 500m ramp, which you would multiply by a fraction (0.2 for example) so the output would be 0 to 0.2 and you can use this output to be the black point of another Linear Step which has the SSS as its input. This will shift the black point of the SSS ramp through altitude 0 to 500, from 0 to 0.2. Giving you that tapered shape at the base of your example.

The next step would be to do the same with the white point so that you have a constant falloff from edge to centre of the SSS disk. To do this, take the output of the Get Altitude/ Linear Step/ Muliply (0.2) you've just made and add another fraction (say 0.3) and plug that into Input 2 (the white point) of the Linear Step you used with the SSS input. This will give the profile 'solidity' in the centre and a feather edge of 0.3 all the way up through its altitude.

You can then use that output to Multiply a Density Fractal, or plug it into the DFs mask input, same thing.

#### Tangled-Universe

Quote from: WAS on November 18, 2019, 01:11:06 PMThanks for the additional information. I did know this. One thing to keep in mind is texture space altitude keys do not relate to altitude heights.

Ehhh...that was basically my whole story/point

#### WAS

Quote from: Tangled-Universe on November 19, 2019, 04:00:58 AM
Quote from: WAS on November 18, 2019, 01:11:06 PMThanks for the additional information. I did know this. One thing to keep in mind is texture space altitude keys do not relate to altitude heights.

Ehhh...that was basically my whole story/point

The offset seems greater than 1000, or am I mistaken? I remember with surface layers I was having to do like -5000 to get around 1750 default base.

It's late and not checking right now. Right mad that windows store won't install anything I just found out. No clue why and no steps online are helping. Was hoping to install the Ubuntu LSS to test the Linux node further but nooo. Ehh nighty night for me

#### RogueNZ

Quote from: Hetzen on November 18, 2019, 05:14:39 PMGood to see you guys working with this setup.

RogueNZ, those profile shapes are possible. One way would be to warp the position of a simple shape shader that has a soft edge using a Get Altitude to determine how it shifts along X or Z through Y. And apply 3 variants with TGD I posted.

You would also need to shift the black and white points of that mask to give you the tapered profile. Colour Adjust does shift black and white points, but it does so statically, ie it doesn't change once set.

So looking at the base of your shape, lets say we have a circular SSS with a radius of 1000m with a Linear edge thickness of 1000m. This node will have a pure white spot in the centre and pure black at its edge, with a linear greyscale ramp from edge to centre.

What you can then do is use a Linear Step node to shift where black and white is within that circles ramp. Just as you can with a Colour Adjust shader. The difference being is the scalar inputs can be adjusted with further functions.

In this example you could use one Linear Step with Get Altitude as its input to create a black point at 0m altitude and white at 500m ramp, which you would multiply by a fraction (0.2 for example) so the output would be 0 to 0.2 and you can use this output to be the black point of another Linear Step which has the SSS as its input. This will shift the black point of the SSS ramp through altitude 0 to 500, from 0 to 0.2. Giving you that tapered shape at the base of your example.

The next step would be to do the same with the white point so that you have a constant falloff from edge to centre of the SSS disk. To do this, take the output of the Get Altitude/ Linear Step/ Muliply (0.2) you've just made and add another fraction (say 0.3) and plug that into Input 2 (the white point) of the Linear Step you used with the SSS input. This will give the profile 'solidity' in the centre and a feather edge of 0.3 all the way up through its altitude.

You can then use that output to Multiply a Density Fractal, or plug it into the DFs mask input, same thing.

Wow thanks Hetzen. Can I ask a stupid question? Is this meant to be driving the density function, or the depth function of the cloud layer?

I'm getting some interesting results (trying the taper), not quite what I am expecting, even though I think I understand your explanation. Will post some shots tomorrow
brendangully.co.nz     |     artstation.com/roguenz

#### Hetzen

The above is about shaping the density shape, so should eventually be plugged in to the Density Shader input.

Whilst you experiment with this, it maybe helpful to turn off the Taper Top and Base toggle in the Cloud Layer/Tweaks tab, so that you can see what's happening with your functions without the Cloud Layers internal altitude falloff. And probably work on one shape at a time. Your mid and top shapes will need the altitude Linear Step to have a Compliment Scalar node before it's multiplied, as you will want your shape to be thinner at the bottom widening out towards the top.

#### Hetzen

I'm also wondering if this topic should be moved into the Function Node General area?

#### Oshyan

Quote from: Hetzen on November 19, 2019, 09:36:56 AMI'm also wondering if this topic should be moved into the Function Node General area?
I was thinking about that too. If you think it's a good fit, happy to do so.

- Oshyan

#### WAS

#24
Quote from: Oshyan on November 19, 2019, 01:26:37 PM
Quote from: Hetzen on November 19, 2019, 09:36:56 AMI'm also wondering if this topic should be moved into the Function Node General area?
I was thinking about that too. If you think it's a good fit, happy to do so.

- Oshyan

Seems like a good Get Altitude / Get Altitude in Texture discussion. I'd maybe rename to the topic to be a little more helpful to find.

Also if anyone figures out how to taper column effects please share. For example in RogueNZ example, how could we do a mix, but in the soft zone, get some expansion or contraction

#### Hetzen

Quote from: Oshyan on November 19, 2019, 01:26:37 PM
Quote from: Hetzen on November 19, 2019, 09:36:56 AMI'm also wondering if this topic should be moved into the Function Node General area?
I was thinking about that too. If you think it's a good fit, happy to do so.

- Oshyan
I'd say so. It's a good base to explain some techniques.

#### RogueNZ

I've spent quite a bit of time playing around and trying to implement Hetzen's suggestions, although I'm now struggling to get the 'natural' cumulus effects I did with my original file. These are some really brain teasing concepts!

Not sure If I have implemented this exactly how you intended. I was also really confused with the effects of the warping. For the mid section (main updraft), I would have thought I should set the black point at zero, and the white point at the top of the cloud, that warp should push the cloud with the base fixed. However I found I had to set the black point at a large negative value (-12000) for this to happen.

There are also quite sharp edges when masking the density fractals, that I never had in the original. In the original, the billows look like they sit on top of the underlying mask, in the latest version they look like they are carving material out of the cloud.

I've attached my original file and the latest version. Please feel free to play with them and see if you can improve. Note the Fractals currently aren't plugged into the density shader.
brendangully.co.nz     |     artstation.com/roguenz

#### Hetzen

#27
That's a good start. I'll have a proper look at your .tgd this afternoon. One thing that will help the fall off cutting into the noise would be to increase the white point fraction number we talked about earlier from 0.3 to say 0.7. You also may need to widen the Simple Shape Shaders to accommodate a wider fall off. This will make the edge transition softer. Also the mix ranges for base, mid and top could also be thicker to allow a softer transition between the zones.

I like to think of these sorts of masks as 'areas of influence' rather than the final shape.

You will also need to find a noise that works well within these bounds. Something less dense in the PF. A Transform Input node will be useful to position a section of your DF noise that visually looks good into your mask zone.

I'll get onto reversing the taper later.

Lastly for now, the anvil section of a cloud tends not to be as dense as the rising stack, so that may need another cloud layer with a softer look to achieve. Not sure if it's technically possible to modulate Edge Sharpness and Cloud Density options in the Cloud node, but I think that would help making these sorts of structures within one node.

#### Dune

I added a white-grey (2-0.5) power fractal as a (blue node) power to the density to get texture in the clouds, and added a transform shader set to world to keep these billows from warping with the cloud. But indeed found that the central column is too dense  in relation to top and bottom.

#### Ariel DK

Ok, this was another thing that i wanted to achieve in my planetary clouds setup for my Earth scene...
Time to revisit that old project again
Hmmm, what version of Terragen does God use?