Clouds following terrain revisited

Started by N-drju, January 12, 2018, 04:37:25 AM

Previous topic - Next topic

N-drju

The title says it all.

It's been a while since I needed anything like that and would now like to implement it to one of my projects.

I tried to follow the acclaimed Martin Huisman's guide but it's not exactly what I need right now. Besides, I think that by now it is slightly outdated.

Is there any good method to provide altitude offset to the clouds directly from the terrain shader? I don't really have time to play around with exporting and converting stuff. Would rather have this done within TG entirely.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

cyphyr

I don't think Martins guide is outdated. It won't work with "Easy Clouds".
You can use the same technique on a procedural terrain. You just need to get some colour info out of the terrain to create a grey scale displacement map that conforms to the terrain.
You could do this by checking the colour tick boxes in the Powerfractal terrain node or adding a y to scalar node between the terrain and the cloud. You also may want to add a colour adjust node.
It is a little tricky working with procedural terrains since being procedural their values are always changing. A bitmap generated terrain will be the same no matter how far it is offset in the y axis. A procedural terrain will change. You will have to compensate for this.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

N-drju

Oh, I see. Darn it, I wanted to skip that greyscale image thingy. :-\ Somehow thought it might be easier.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

#3
Yeah there should be a way to get the actual displacement information and turn that into a colour map.  Having to produce the colour in height is stupid. Not practical. Seems  you have to build the entire project based around offset clouds, instead of it being something added to your scene.

I've been using Displacement Shader to Vector and Scalar, and both just make the clouds disappear, with colour output from a PF, using the same nodes Dune did.

Even using the SSS colour and smooth step doesn't seem to work.

My final goal is to just have clouds running along the grounds altitude, and than I thought I could use a Surface Layer masked by the SSS for the displacement, and Substract Scalar to pull the clouds down.

Matt

It will work, but if it was previously set up to use a colour input and now you use a displacement converted to a scalar, you'll need to account for the fact that the displacement is measured in metres, so typically the values will be far outside the 0..1 range that was previously used.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#5
Quote from: Matt on May 15, 2018, 11:48:41 PM
It will work, but if it was previously set up to use a colour input and now you use a displacement converted to a scalar, you'll need to account for the fact that the displacement is measured in metres, so typically the values will be far outside the 0..1 range that was previously used.

Matt


Just can't seem to get it to work. Tried multiple methods. The scaler can make the clouds disappear or thin out, but not altitude changes are ever made.

Additionally I played around with a colour adjust on a displacement to scaler and all it also does is thin clouds or make them disappear, never effects altitude.


WAS

#6
Really though, is there an issue going on here? Even rendering a "Perfectly working" tgd, yields no altitude offset...  I'm very puzzled.  Doesn't look the same of the provided sample image, nor following the mountain, just the mountain peaking through.

Note: Finally got this working by saying screw it with these methods and just used a disp to scalar and colour adjust to dial in look I wanted with two inputs. <.<

N-drju

It does work WASasquatch even with Martin's original setup. The thing, however, is that you need to significantly deepen the cloud depth to have any noticeable effect.

First and foremost, keep in mind that clouds "cannot exist outside their boundaries" - if you need to cover a peak from 200 to 1000 meters, you will, ideally, need a cloud located at 600 meters with 800 meter depth.

Still, I found out that the cloud depth needs to be significantly exaggerated to get best results. In one of my pictures I needed to cover 400 meter altitude span and got eye-pleasing and topo-correct effect only after expanding cloud depth to 2000 meters... ::)

For some reason, Terragen seems to chop off topmost area of clouds in the "localize" mode. So if you set cloud ceiling to say, 3000 you will rarely get any clouds at that altitude. The cloud mass will typically fill the area in the 2/3 of the initial depth, so you need to adjust accordingly.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Oshyan

In Localize mode the cloud is bounded by a sphere and the shape/falloff (at the edge) is controlled by the Falloff and Value at Radius parameters. Taper Top and Base also has an effect. Combined the effect is that your cloud seldom actually fills the total vertical span of your cloud volume, but this does generally provide more realistic effects for falloff at top and bottom and is why they're all enabled by default.

- Oshyan

N-drju

I agree. It's just not good for all situations. Like the one discussed here.

What I also found helpful, was flattening the cloud base. The cloud is even thinner when this is applied but then, when you expand depth, you can get some very impressive cloud masses.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

#10
Quote from: N-drju on May 21, 2018, 03:01:44 AM
It does work WASasquatch even with Martin's original setup. The thing, however, is that you need to significantly deepen the cloud depth to have any noticeable effect.

First and foremost, keep in mind that clouds "cannot exist outside their boundaries" - if you need to cover a peak from 200 to 1000 meters, you will, ideally, need a cloud located at 600 meters with 800 meter depth.

Still, I found out that the cloud depth needs to be significantly exaggerated to get best results. In one of my pictures I needed to cover 400 meter altitude span and got eye-pleasing and topo-correct effect only after expanding cloud depth to 2000 meters... ::)

For some reason, Terragen seems to chop off topmost area of clouds in the "localize" mode. So if you set cloud ceiling to say, 3000 you will rarely get any clouds at that altitude. The cloud mass will typically fill the area in the 2/3 of the initial depth, so you need to adjust accordingly.


Cloud localization and depth isn't the issue at all. As you can see from my render of Martin's this method simply isn't working on my system for whatever reason. Maybe it's the old file, I'd like to see you render a comparison compared to the original image posted. I've been downloading and working on this method for over a week. I have tried many files without alterations. It doesn't work. The only file that looks like it partially work was just an exploded mess of pixels, not clouds.

When I do this myself, depth is always beyond normal control. I actually often use a Surface Layer for height control, actually, as falloff control on clouds is pretty hard to deal with for tops and bottom.

The issue is the method doesn't work for me... I used a simple disp to scalar and a colour adjust and it works just fine for my Arid Plateaus while Martin's provided a solid, flat, layer. Not to mention this method is a lot easier. You have two value inputs to worry about, and wether you want to clamp low and high colours. Works amazingly.

N-drju

#11
Hm, that's interesting. Would you mind sharing it? If you found an easier method, many of us would greatly appreciate.

Okay, I see. Cloud depth was the main issue in my case so I thought you might want to reconsider. Cloud depth modifier and cloud alt. offset modifier also play a key role.

Are you sure you applied and converted a correct image file for displacement mapping? It has to be exactly where you want your clouds to follow terrain. This is one more element where something might go wrong.

Surface layer cannot control height or depth of a cloud... The shape of edges, yes, but not anything else. I can't envisage how you could have used it...?
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

#12
Quote from: N-drju on May 23, 2018, 02:06:26 AM
Hm, that's interesting. Would you mind sharing it? If you found an easier method, many of us would greatly appreciate.

Okay, I see. Cloud depth was the main issue in my case so I thought you might want to reconsider. Cloud depth modifier and cloud alt. offset modifier also play a key role.

Are you sure you applied and converted a correct image file for displacement mapping? It has to be exactly where you want your clouds to follow terrain. This is one more element where something might go wrong.

Surface layer cannot control height or depth of a cloud... The shape of edges, yes, but not anything else. I can't envisage how you could have used it...?


I was using the high and low colour method from PF, not the image map method mainly. I was doing some work on my arid landscape scene and I moved my camera to a new position, and noticed the method I thought worked, didn't, it just varied the top of the clouds enough not to look straight.

Do not understand this altitude offset function or why it's so broken and requires special treatment outside the scope of procedural workflow. No offense to Matt, but this function needs an entire rewrite. it shouldn't be that hard to offset clouds, especially achieving natural looks without a mess of functions, or pixels in the final work.

Here's the file I've been working on... I've gone from dozens of functions to just the disp to scalar, nothing works.

You'd think by the logic of Terragen, with Camped Black, black should be 0, and anything else is lifted, yet it applies nothing to the clouds, even if you ramp up white [clamped or not] to lets say 1e+011.

Dune

I think something is changed since a few years back. Then it wasn't hard to get it working, but now I can't get it to work either, even in this rather old 32-bit version, the only one I have here, online). I'll have to check some of my older files, but this is what I used to do.
The constant has a flattening effect, the altitude is changed for the top part, but it used to hollow out/lift the bottom part as well. Now it's still solid. Funny (or not so funny, actually).

N-drju

So what you both say is that it might be a system dependent problem...? ???

For me it works on Win 8.1 and TG3.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"