Clouds Mini Tutorial -> .tgd in File Sharing

Started by Tangled-Universe, February 10, 2021, 05:56:16 PM

Previous topic - Next topic

Tangled-Universe

Just saw someone asking something about how to build certain clouds.
While this does not answer that particular question, I thought I'd share this render and its project file for sharing some tips/tricks/ideas.
Hope you enjoy it!

You can find the .tgd here:
https://planetside.co.uk/forums/index.php/topic,28879.0.html

WAS

This does look very nice, though I see some sort of faint lateral banding happening. I wonder if using get altitude and modulating it doesn't have smooth continuity (clamped scalars or something).

Tangled-Universe

Yes I noticed that too, but it's not because of that.
It's the ray marching quality which causes that, usually, and then also in combination with low'ish AA.
Here's a render with slightly increased ray marching quality and AA.

Tangled-Universe

#3
Adendum to your remark:
The get altitude itself does not cause 'stepping'. The smoothness of the output is determined by shader calling it.
If voxel count and ray marching quality is low, then the get altitude is effectively sampled more coarsely as well.
The gradient can be very smooth accross voxels, especially with gamma applied, and thus harder to sample.

Also, notice how there are fewer vertical voxels in the shader. It's why these problems appear when gradients are smooth, but the cause is in the cloud shader, not in the output of the get altitude.
Increasing ray marching quality usually helps and in more rare cases you need more voxels.
(At least, rare for me, since I tend to render with high voxel counts)

I recently noticed it in a scenario like below:
If you create a solid pure cloud (density and sharpness @ 1) and render the bottom at a camera angle facing 10-20 degrees up then you can investigate the effect of raymarching quality.
At ray marching quality 0.1 you'll see banding show up. It disappears if you increase this setting.

WAS

#4
Maybe we aren't seeing the same thing? Even in your modified version I see this weird faint lateral effect, almost like terracing. I tried switching all noise over to better continuity, and unclamped the altitude masks, but it only helped soften the effect (though I assume there is some post on your images), but it's still there. Is this really ray marching? I've never seen this.

PS I totally don't mean to poop on this, just curious what's causing this because I like the setup and noise mixing here a lot.

Tangled-Universe

#5
Don't worry, I know you don't mean to poop on this.

Yes we are looking at exactly the same area. It's where I noticed it too.
I think it's a combination of the aforementioned render settings and that the warping of the bottom of the clouds is contributing to it as well, perhaps.

The screenshot_386 you just shared is rendered at low quality and I don't really see what fits your description and/or the kind of moire(-like) banding we both observed in that part of my scene/render.
I think it improves greatly when rendering it at higher ray marching quality and higher AA.
Sometimes I also think the lower vertical voxel resolution is set relatively too low and perhaps causes this banding.

Unclamping the altitude masks automatically disables the gamma function, so I'm not surprised the effect is softened by them. This does not mean that the altitude mask is *causing* it.
The function (after unclamping) became linear. With gamma 0.25, for instance, values from 0-0.2 are remapped to be very close to zero. Similar accounts for the range 0.8-1.
When looking at the depth modulator this means that, for gamma 0.25, the depth increases rapidly for values 0.8-1. Creating a steep ramp over a small X/Z area. Similar to how geometry stretches on vertical surfaces.
Here we also try to fix that with very small compute terrain patch sizes, so that we can more precisely calculate normals and texture coordinates.
If there aren't enough shading points called for by the cloud shader, due to too low voxel count or insufficient ray marching, you also sample those steep gamma transitions insufficiently.
This is why I think that the lower vertical voxel resolution is contributing to the problem.

In this case it might help to realize that the node network's workflow is 'top to bottom', but internally the software parses the network from the planet node up to the 'get functions'.
Get altitude just gives the altitude at a certain shading point requested by the shader 'below' it.

Sorry if this was a bit too elaborate/heavy on arguments and/or examples. I don't mean to tutor you on any of this, you know your stuff, but I hope the discussion helps others somewhat :P

edit 2: added render with AA12, RMQ 1.5 and 500M voxels. No post-process.

WAS

#6
That does look a lot better, though surprised to still see noise at that AA. Haha. Well that makes a lot of sense, and you're right about the underlying warping.

Tangled-Universe

Yeah I rendered it with PT, by accident. Perhaps I should re-render it with standard render and see if the noise is PT or cloud shader related.

WAS

I'm having a lot of fun right now playing with the get altitude idea you have. This seems to be a great fix for blown out depth modulators. Thanks again for sharing this setup.

The get altitude seems to be a little more dynamic with cloud position from what I'm seeing, making is perhaps better than dialing in surface layer alts.

Tangled-Universe

Yes I discussed this briefly with Ulco, who is a surface layer adept, but I find the surface layer and its fuzzy zone settings "fuzzy" (sorry for the corny pun).
For me this method works more exact and predictable. Though in the end, it probably does not matter, as long as it works and allows you to do what you want to do.

WAS

Quote from: Tangled-Universe on February 12, 2021, 04:00:39 PMYes I discussed this briefly with Ulco, who is a surface layer adept, but I find the surface layer and its fuzzy zone settings "fuzzy" (sorry for the corny pun).
For me this method works more exact and predictable. Though in the end, it probably does not matter, as long as it works and allows you to do what you want to do.

Yeah, that's true, it can be more fuzzy. And hey, if you want more fuzzy I found playing with the gamma of the get altitude in texture does just that.

Tangled-Universe

Indeed.
Also, be aware that the get altitude function is not confined to the cloud layer volume. So if you choose to have a density build-up from bottom to top, then you don't need to set the black level to the base altitude of the layer.
You can also set it to below the base altitude so that you have at least some density to start with.