Low level cloud control

Started by james adamson, February 08, 2020, 07:17:34 AM

Previous topic - Next topic

Matt

WAS, perhaps you could make yours more accessible by adding a note about your choices of displacement multiplier (-0.45), what the "Cloud Layer A" node does, and which of its settings are important. BTW, The Redirect Shader is not needed.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

A note for both of these setups. If you're using "Move textures with cloud", if the cloud isn't at the origin it's going to sample the terrain incorrectly and the effect will stop working properly.

You can fix this by using a Transform Input Shader on your terrain input, set to "Use world space".
Just because milk is white doesn't mean that clouds are made of milk.

WAS

That's a good point about the terrain scalar moving with the clouds. Lol That'd look funny.

I used negative input because the initial effect was actually sinking the clouds in my example and in a "What the heck" fashion I just inverted the displacement , and got a more desirable effect. This may not be needed in all scenarios. The cloud layer altitude offsets are negative because of the clouds base altitude (if I remember correctly), I believe by 2000m, so I set them accordingly. Breakup is inverted to try to maintain the cloud effect it'd have without a surface layer, though I did not adjust these with the fuzzy zone at all and would probably need adjustments.

I was worried about warping inadvertently effecting fuzzy zones (cloud shapes basically) which is why I choose a redirect on Y. Good to note, thanks.

WAS

#33
Good to note also, because this is a scalar of your terrain, the displacement shader is exponential. 1 is the scalar in it's base, and 2 would be double the terrain height scales. Bumpy car ride and other discussions aren't making explanation easy so sorry if I forget something. Be sure to always ask questions if you're unsure. Someone will definitely help.

Another thought is clamping terrain scalar to have more of a floor and worry about the high peaks but I think that's for another example.

Matt

When using these setups on a complex terrain like you might see in a real project, it will make the clouds very slow to render. You can fix this by baking the terrain into a heightfield and using a Heightfield Shader as the source of the cloud altitude offset (Tangled-Universe setup) or warper (WAS setup). It's a few extra steps but it makes it practical to use with many kinds of terrain.
Just because milk is white doesn't mean that clouds are made of milk.

Tangled-Universe

Quote from: Matt on February 12, 2020, 02:25:33 PMMartin, there is an incorrect connection in your setup. You'll need to connect the Sin rather than the Displacement Shader.

I think both of these examples are different enough that it's not fair to assume that one is easier than the other.


Ah yes, shit, that's a remnant of testing the displacement shader to scalar input.
The note shader does explain this though.
I will re-upload.

The sinus based terrain is perhaps not beginner-friendly, but the cross-section approach of presenting the terrain and the cloud layer makes it much easier to understand the settings of modulating the cloud.
Since this is a cloud modulation discussion I considered my node-light solution the easiest. There's as little as possible plugged into the cloud.

Tangled-Universe

Here's the corrected file, sorry for the inconvenience guys.

WAS

Quote from: Matt on February 12, 2020, 04:02:07 PMWhen using these setups on a complex terrain like you might see in a real project, it will make the clouds very slow to render. You can fix this by baking the terrain into a heightfield and using a Heightfield Shader as the source of the cloud altitude offset (Tangled-Universe setup) or warper (WAS setup). It's a few extra steps but it makes it practical to use with many kinds of terrain.
That's actually a really simple idea to speed things up I hadn't thought of. You could also likely get away with a low resolution too as you don't really need jagged info for altitude offsetting for a distance. It may also breakup the cloud if too rough like spikey peaks.

james adamson

Wow guys! All this assistance is amazing! 
Plenty for me to be getting on with and another steep learning curve ahead. I am gonna take a look at all suggestions cos thats how one learns I guess.
I will post some results for feedback at some point.
Thanks again.
James..

WAS

#39
Quote from: Tangled-Universe on February 12, 2020, 04:07:44 PMHere's the corrected file, sorry for the inconvenience guys.

It's odd you talk about the complexity of my setup when yours isn't any better (especially in a comprehensive real-world example with terrain and real clouds). Did you re-read your notes too, what a winder? Lol

Also this method isn't really appropriate. You're crunching the cloud shapes down to a ribbon (depth modulator) which will affect all the cloud shapes in a fractal by crunching. That will not look right for clouds. They'll also crunch along the altitude offset smoothly (as your ribbon represents) creating slants along the offset which won't be realistic. You also incorporate too much negative disp floors into your equation which wouldn't be realistic for cloud layers in an atmosphere. You'd be thinking about peaks protruding into the atmosphere. You don't want clouds randomly sinking just cause theres a small divot on the level surface 500-1000m below the clouds. Little offset should be going a long way. This is why I mentioned clamping floors in a previous post.

You'd think you'd be giving a real-world example of usage of real clouds and not thinking about some weird abstract method like this that isn't real translatable to a real scene to obtain offsetted clouds in as much of their entirety as possible without bizarre effects.

james adamson

Hi all. Once again I very much appreciate the time and effort put into helping me with this cloud setup I am trying to achieve. I would have no chance on my own. Right.. this is a long one. Martin I have tackled your setup first and I have quite a few questions so apologies for the length of this post.
I am going to explain it as I understand it if at all.

1. So the blue nodes going up to the sin node are essentially extracting a vector and creating data to create the terrain and the cloud offset function in this example?
2. The sin function is just there to build a terrain as a visual aid and to show cloud following terrain as it also feeds into the altitude offset.(to be replaced with what in a real world scene?)
3. When I have my final terrain where would the blue nodes leading up to sin go in my network. (Power fractal does not have a function input.)
4. What is the displacement to scalar doing it is not plugged in. Is that a stand in for what a heightfield generator would create and does it do the same job as a heightfield generator foregoing the image creation stage but increasing computing overheads ?
5. The rectangular cloud simple shader? Is that just a stand in node to be replaced with some other more complex density function?
6. Aaaaand finally, the depth modulation constant. Why is that at 0.08? Is that just an arbitrary number to be adjusted to taste in a final scene?
Right, onto the other version.
Thanks again.
James.

WAS

Quote from: james adamson on February 20, 2020, 07:56:10 PMHi all. Once again I very much appreciate the time and effort put into helping me with this cloud setup I am trying to achieve. I would have no chance on my own. Right.. this is a long one. Martin I have tackled your setup first and I have quite a few questions so apologies for the length of this post.
I am going to explain it as I understand it if at all.

1. So the blue nodes going up to the sin node are essentially extracting a vector and creating data to create the terrain and the cloud offset function in this example?
2. The sin function is just there to build a terrain as a visual aid and to show cloud following terrain as it also feeds into the altitude offset.(to be replaced with what in a real world scene?)
3. When I have my final terrain where would the blue nodes leading up to sin go in my network. (Power fractal does not have a function input.)
4. What is the displacement to scalar doing it is not plugged in. Is that a stand in for what a heightfield generator would create and does it do the same job as a heightfield generator foregoing the image creation stage but increasing computing overheads ?
5. The rectangular cloud simple shader? Is that just a stand in node to be replaced with some other more complex density function?
6. Aaaaand finally, the depth modulation constant. Why is that at 0.08? Is that just an arbitrary number to be adjusted to taste in a final scene?
Right, onto the other version.
Thanks again.
James.

Depth modulator basically crunches the cloud fractal. So 1 is default cloud fractal, 0, is no cloud fractal. His setting was to create a ribbon. I believe his project was more or less just designed to make sure the function was working correctly. For your clouds you may or may not need it. If so a range of 0.5-0.75 may do it. Your depth modulator could also be based on your cloud fractal smoothed with the smoothing filter, to retain some of the shape depth. Fiddling with these settings with a colour adjust to get a desired look.

james adamson

Cheers Was.
 Im gonna take a more in depth look at your setup next. Both seem to be doing what I am after in slightly different ways and to be honest both are beyond where I am on my learning curve at the moment but hey thats the point, so expect a barrage of questions on your setup at some point tomorrow evening.
And once again, thanks for your help.
Cheers.
James.

Tangled-Universe

Quote from: james adamson on February 20, 2020, 07:56:10 PMHi all. Once again I very much appreciate the time and effort put into helping me with this cloud setup I am trying to achieve. I would have no chance on my own. Right.. this is a long one. Martin I have tackled your setup first and I have quite a few questions so apologies for the length of this post.
I am going to explain it as I understand it if at all.

1. So the blue nodes going up to the sin node are essentially extracting a vector and creating data to create the terrain and the cloud offset function in this example?
2. The sin function is just there to build a terrain as a visual aid and to show cloud following terrain as it also feeds into the altitude offset.(to be replaced with what in a real world scene?)
3. When I have my final terrain where would the blue nodes leading up to sin go in my network. (Power fractal does not have a function input.)
4. What is the displacement to scalar doing it is not plugged in. Is that a stand in for what a heightfield generator would create and does it do the same job as a heightfield generator foregoing the image creation stage but increasing computing overheads ?
5. The rectangular cloud simple shader? Is that just a stand in node to be replaced with some other more complex density function?
6. Aaaaand finally, the depth modulation constant. Why is that at 0.08? Is that just an arbitrary number to be adjusted to taste in a final scene?
Right, onto the other version.
Thanks again.
James.

Hi James,

I'll try to explain a few things, but you're a few steps ahead of me as I'm still working on a simple real user case example without sin stuff.
The sin stuff is just there to create a simple terrain shape that can be easily interpreted.
Using some basic math and logic you can create a terrain with absolute values for altitudes which take all the guessing away and forces one to fully understand the function operations.

The take away message from that project file is really in the note shaders for the cloud layer.
The formulas and logic is what you need to understand and for that it's sufficient to believe me when I say that the terrain you see has a certain altitude span and that we work from there.
I understand you'd like to  understand it, but it's not the aim of the file.

Perhaps by explaining this approach in the project file I also drew attention to this aspect of the scene, but I did not intend to.
I chose to do so nonetheless, because there's no better way than explaining something when it's stripped from all other variables with unpredictable outcome.
For instance, displacing a fractal with 2000 does not necessarily result in a terrain ranging from -2000 to +2000 meters, but I actually don't want to talk about this because it might only cause more confusion.

I'll try to answer your questions as briefly as possible.

1) Yes
2) Consequently to the answer for #1, yes.
3) The sin stuff is just to create a super super simple terrain with absolute certainty of the altitudes so that we can fully test and understand the cloud function inputs.
4) Yes that's correct. With the sin stuff you know that you create something with a certain range of values. A displacement shader to scalar converts the input terrain to the range of values of that terrain, but those values are not truly known by the user, since it's a fractal. You can predict it, but it's more 'rule of thumb' than absolute. More about this in a future file.
5) Correct. The terrain is a sinus shaped ribbon so that I can create a cross-section view. A cloud layer has a circular bounding box so to make sure it's also a ribbon you can simply use a simple shape shader in the shape of a ribbon and use that as density function for the cloud.
6) That explanation is in the note shader. You can double-click on the note shader's name and a box will open containing the explanations.
This should also help with the sinus stuff.

james adamson

A note for both of these setups. If you're using "Move textures with cloud", if the cloud isn't at the origin it's going to sample the terrain incorrectly and the effect will stop working properly.

You can fix this by using a Transform Input Shader on your terrain input, set to "Use world space".

Hi all.
Oshyan you wrote the above on this thread a while back. I am having trouble understanding what you mean. I think I understand that using either of the two methods that Was and Martin describe that the way the clouds are generated is directly linked to the terrain displacement texture, so there is some offset that could possibly be created....
I think?  So would I put a transform input in between the displacement to scalar shader. (if that was the route I was going down.) and the alttitude offset input
on the cloud v3?
Cheers.
James.