Planetside Software Forums

General => Terragen Discussion => Topic started by: james adamson on February 08, 2020, 07:17:34 AM

Title: Low level cloud control
Post by: james adamson on February 08, 2020, 07:17:34 AM
Hi all.
I am trying to add some low level cloud to my scene. What I am after is pretty dense rolling low level cloud that interacts with the terrain.
i.e It appears to roll around the mountains. My camera is in the middle of a huge valley/gorge and I am trying to get the clouds to roll right up to and past my camera. I am trying to get that dense cloud layer that clearly is interacting with the scene around it. Trees popping through that sort of thing. I got some good 
results with easy cloud at a distance but my lack of knowledge on whats actually going on is restricting control other than height/density/depth. I moved onto trying v2 and v3 after reading some posts and I have seen post where Volker Harun talks of sculpting clouds like "scooping ice cream." Sounds fun, any pointers anyone.
Thanks in advance.
James.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 08, 2020, 11:06:35 AM
Hi James,

Can you post a render of your scene thus far and describe your wishes?
If you also post a .tgd I can show you how to make your cloud interact with the terrain.

Cheers,
Martin
Title: Re: Low level cloud control
Post by: james adamson on February 08, 2020, 01:00:10 PM
Hi Martin.

Thanks for the response.

Here is a rough setup and a still. I have not yet rendered anything animated. I think you get the idea from the still.

I am after dramatic rolling clouds/mist licking around and over the terrain.


Many thanks.
James.
Title: Re: Low level cloud control
Post by: WAS on February 08, 2020, 02:29:17 PM
Clouds are unaware of the terrain, so there is no collision to really do this accurately, but youl could use a altitude offset to try and simulate some of the effect on the clouds moving over the terrain.

Honestly I think this is something more suited for a art directable approach, which TG is more procedural.
Title: Re: Low level cloud control
Post by: james adamson on February 08, 2020, 02:50:37 PM
Yeah I guess it is more of a dynamics process, but if I can cheat it in Terragen ???
Title: Re: Low level cloud control
Post by: james adamson on February 08, 2020, 02:51:54 PM
Not sure what that emoji is doing there. Was supposed to be a few question marks.
Title: Re: Low level cloud control
Post by: mhaze on February 09, 2020, 04:59:36 AM
This possible but complicated. Somewhere on the forums there should be an explanation.
Title: Re: Low level cloud control
Post by: mhaze on February 09, 2020, 05:10:37 AM
I've found the tutorial.
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 06:46:20 AM
Thanks Mhaze I will take a look.
and activate brain!
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 07:23:53 AM
Cheers Mhaze, just looked at that tutorial. It is exactly what I am after. Just gotta make it work now :o
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 08:33:01 AM
Hi again. Where did you find that tutorial? I am looking for the tgd files and can not find the original tutorial anywhere on the forum.
Cheers.
James.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 09, 2020, 09:22:48 AM
I made that tutorial, but I need to check if it's still up to date and correct.

Now you know why I offered to help ;)
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 10:14:58 AM
Ha Ha....
Found it and all the bits looks like its doing the right stuff.
I have said it before and ill say it again. This forum is as wonderful as the software itself.
Cheers.
James.
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 10:22:50 AM
I believe the main difference and please correct me if I am wrong is that you can now directly export the heightfield as an exr image.
Will this have any implications on the result? Also the image in your scene derived from the heightfield looks odd when I viewed it in Nuke. It is just a pixel wide
and red? I also do not understand the constant as a depth modulator. Is that just creating a depth offset?
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 10:24:56 AM
Oh and displacement to scalar is now a function node. Was that available when you made the tutorial and could I use that in between the  terrain output and altitude offset function?
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 09, 2020, 10:27:16 AM
A few things have changed ever since, so I'd have to update it.
I will check your file and see how/if I can make it work and post here again with explanations.
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 10:33:34 AM
Ignore the sgi image issue. Nuke playing up. Looks fine but the exr is just black and white. It seems to  have lost all detail.
Title: Re: Low level cloud control
Post by: james adamson on February 09, 2020, 10:34:21 AM
Amazing.
Thanks.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 09, 2020, 06:20:21 PM
I'm checking it out, but I'm running into some issues which make me wonder if the functions are still working properly or changed slightly in the way they are supposed to work.
My approach described in that PDF does not work (for me) anymore.

I'll report back later...
Title: Re: Low level cloud control
Post by: WAS on February 09, 2020, 07:29:04 PM
Quote from: Tangled-Universe on February 09, 2020, 06:20:21 PMI'm checking it out, but I'm running into some issues which make me wonder if the functions are still working properly or changed slightly in the way they are supposed to work.
My approach described in that PDF does not work (for me) anymore.

I'll report back later...

Yeah I mentioned this in another topic. Even disp to scalar in my older projects that was setup nicely with colour adjusts is now more or less looking flat.
Title: Re: Low level cloud control
Post by: james adamson on February 11, 2020, 03:18:04 PM
Cheers guys.
Im attempting to get it working.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 11, 2020, 05:12:40 PM
Sorry I haven't had time yet, but should have more time tomorrow.
Title: Re: Low level cloud control
Post by: james adamson on February 11, 2020, 05:17:59 PM
No worries.
Your existing tutorial has given loads of pointers and stuff to play with.
Much appreciated.
James.
Title: Re: Low level cloud control
Post by: pokoy on February 12, 2020, 07:15:07 AM
Hmm this would back up my suspicion that some things don't work the way that used to. I remember setting up clouds to follow the terrain way back and it worked, tried a few times with recent TG versions and it didn't... but I gave up instead of trying harder. Intrigued to see where this is going.
Title: Re: Low level cloud control
Post by: WAS on February 12, 2020, 12:31:37 PM
When I asked about this in a topic Matt was involved with I believe he said nothing has changed, so it's a curious topic.

In the meantime you may look into the technique I posted year back or so about using surface layers to simulate cloud layers within one single large depthed cloud layer. These surface layers can be warped on Y giving you much easier control.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 12, 2020, 01:25:24 PM
OK this is test 1, a very basic one.

This .tgd contains 2 note shaders with explanations.
The 3D preview mode is better in RTP or use renders instead, it's pretty fast.

So base functionality is still intact.
Next will be a more realistic user scenario, because who builds sinus terrains...
Title: Re: Low level cloud control
Post by: WAS on February 12, 2020, 01:43:31 PM
Here's a cloud layer redirect example as well. With this version, because of the large depth, you may need to compensate voxels. It can be a little more art directive I think cause it's easier to control disp/warp input. Settuping up the cloud layers themselves is annoying though.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 12, 2020, 01:50:52 PM
Interesting with 0 downloads for my file that you manage to conclude your setup is more art-directable and easier to control disp/warp input.
But thanks for sharing your method anyway.

In the meantime I will work on re-evaluating the intended workflow as designed, because I want to keep the discussion as simple and concise as possible so that everyone can benefit from James's request for help.
This is James's topic, remember. He needs help and is relatively new, so let's keep things simple and centralized and not make a competition out of it.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 12, 2020, 01:52:32 PM
Quote from: WAS on February 12, 2020, 01:43:31 PMHere's a cloud layer redirect example as well. With this version, because of the large depth, you may need to compensate voxels. It can be a little more art directive I think cause it's easier to control disp/warp input. Settuping up the cloud layers themselves is annoying though.

I just checked it out.
Definitely a nice study object, but no way...really no way that a starting user can understand what you are doing here. This is not helping James or other people struggling with this, I'm sorry.
Title: Re: Low level cloud control
Post by: Matt on February 12, 2020, 02:25:33 PM
Martin, 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.
Title: Re: Low level cloud control
Post by: Matt on February 12, 2020, 02:38:07 PM
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.
Title: Re: Low level cloud control
Post by: Matt on February 12, 2020, 02:42:05 PM
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".
Title: Re: Low level cloud control
Post by: WAS on February 12, 2020, 03:31:01 PM
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.
Title: Re: Low level cloud control
Post by: WAS on February 12, 2020, 03:35:39 PM
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.
Title: Re: Low level cloud control
Post by: Matt on February 12, 2020, 04:02:07 PM
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.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 12, 2020, 04:06:57 PM
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.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 12, 2020, 04:07:44 PM
Here's the corrected file, sorry for the inconvenience guys.
Title: Re: Low level cloud control
Post by: WAS on February 12, 2020, 06:49:38 PM
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.
Title: Re: Low level cloud control
Post by: james adamson on February 13, 2020, 10:48:16 AM
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..
Title: Re: Low level cloud control
Post by: WAS on February 13, 2020, 01:08:21 PM
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.
Title: Re: Low level cloud control
Post by: james adamson on February 20, 2020, 07:56:10 PM
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.
Title: Re: Low level cloud control
Post by: WAS on February 20, 2020, 08:10:52 PM
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.
Title: Re: Low level cloud control
Post by: james adamson on February 20, 2020, 08:40:59 PM
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.
Title: Re: Low level cloud control
Post by: Tangled-Universe on February 21, 2020, 04:19:57 PM
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.
Title: Re: Low level cloud control
Post by: james adamson on February 22, 2020, 07:27:45 AM
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.
Title: Re: Low level cloud control
Post by: james adamson on February 22, 2020, 08:07:54 AM
Thanks for that explanation Martin. 
Extremely helpful.
James.