Fuzzy Zones Colour Falloff Problem

Started by WASasquatch, October 01, 2018, 03:25:05 pm

Previous topic - Next topic

WASasquatch

Is there anyway to defeat TG hard falloff? With surface layers I can never achieve actual smooth transitions. There is always a noticeable line where it drops from above 0 to 0. The only way to defeat it is breakup, but that doesn't help with smooth gradient transitions.

Here you can see the lines created by two surface layers with no breakup and fuzzy zones.

There seems to be a falloff at both 1 to below 1 and from above 0 to 0.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

N-drju

Hmm, I always use SSS for smooth transitions be it colors, textures, terrain, even clouds. It leaves no seams at all and, personally at least, I consider it to be the best transition tool, especially combined with warpers.

You can make entire smooth transition chains that way, though you need to remember to disable black color.
"When dictatorship is a fact, revolution becomes a right."

WASasquatch

October 01, 2018, 04:37:39 pm #2 Last Edit: October 01, 2018, 04:42:55 pm by WASasquatch
Quote from: N-drju on October 01, 2018, 03:59:47 pm
Hmm, I always use SSS for smooth transitions be it colors, textures, terrain, even clouds. It leaves no seams at all and, personally at least, I consider it to be the best transition tool, especially combined with warpers.

You can make entire smooth transition chains that way, though you need to remember to disable black color.



It's unfortunately entirely useless for altitudes.

I suppose the problem is probably due to the fuzzy zones being clamped, at least they appear to be from 2D preview.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

N-drju

You can make an SSS altitude-dependent too, though it may be too cumbersome for your application. This is what I made in the Simple Strata Shader file. Notice how strata area starts only 1/3 up the mesa's altitude:

https://planetside.co.uk/forums/index.php/topic,23627.msg239126.html#msg239126

The trick is that one SSS is tighter, therefore affecting higher altitude than the other SSS. I think I also used distribution shader combined with SSS... not sure how the node network looked, but I think I made it somehow.
"When dictatorship is a fact, revolution becomes a right."

WASasquatch

October 01, 2018, 04:54:21 pm #4 Last Edit: October 01, 2018, 04:58:45 pm by WASasquatch
That would rely on slopes. Not really possible when the zone you're working with is an outcrop pass the vertical base.

It also seems it could also be part of how TG handles geometry. Note this hard transition pyramid with SSS. It's faces are smooth, but when applied a surface layer, it creates subdivided like edges, new faces, basically. Naturally this wouldn't be as viable when the terrain has fine detail and isn't smooth. The cliff I'm working with all has smooth faces, with hard edges, which may just be translating badly with the compute terrain patch size, and planet displacement tolerance. But I'm not sure how to adjust to fix. A smaller patch size gives you better/more faces, but nothing smooth.

Note, the idea here was to create a offset like the remaining plaster on the great pyramids, and than fractalize and vdisp warp the fuzzy zone on Y to mimic the look IRL.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Dune

You are correct in saying that the fuzzy zone is clamped (at least, that was my conclusion too), and I've struggeld with this hard edge over the years too, so looked for a solution. I use a get altitude, with a smooth step, masking whatever you want masked. But you need a compute terrain.
You can also use a get altitude in texture, which will give a more erratic altitude (likely due to patch size), but that can be warped. Handy too.
I thought I had another way too, but I can't remember atm.

WASasquatch

October 02, 2018, 02:00:38 am #6 Last Edit: October 02, 2018, 02:03:24 am by WASasquatch
Wow, what nifty masking methods Ulco, thanks for sharing. This is definitely going to come in use.

I wonder if Matt might throw that on a future update for the surface layer, a simple Clamp Fuzzy Zone checkbox.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Matt

I've been looking into this and I see what's causing it now.

The fuzzy zone uses a smooth step, so that's not the problem. It also uses an exponential function, but instead of using exp() it uses a fast approximation which has some discontinuities in the first order derivative. You don't notice this problem when it's only used for colour, but when it's used to affect displacement you notice a few edges within the fuzzy zone. It's not just a problem at the very edge of the fuzzy zone; it occurs at multiple points in the fuzzy zone.

There was a similar problem in the Power Fractal and in 4.1 I added new options called "better colour continuity" and "better displacement continuity". They are a little slower to calculate but solve these issues. I'll need to add something similar to Surface Layer's constraints feature.
Just because milk is white doesn't mean that clouds are made of milk.

WASasquatch

Quote from: Matt on October 02, 2018, 11:34:02 pm
I've been looking into this and I see what's causing it now.

The fuzzy zone uses a smooth step, so that's not the problem. It also uses an exponential function, but instead of using exp() it uses a fast approximation which has some discontinuities in the first order derivative. You don't notice this problem when it's only used for colour, but when it's used to affect displacement you notice a few edges within the fuzzy zone. It's not just a problem at the very edge of the fuzzy zone; it occurs at multiple points in the fuzzy zone.

There was a similar problem in the Power Fractal and in 4.1 I added new options called "better colour continuity" and "better displacement continuity". They are a little slower to calculate but solve these issues. I'll need to add something similar to Surface Layer's constraints feature.


Thanks for this post Matt, not only explains the issue here, but helps me better explain these additions to the PF shader. It also explains the anomalies on smooth displacement like SSS shapes. I notice in looking back at the pyramid, for example, the extra edges don't have anything to do with the actual fade of displacement. Which does fade with a perfect transition from what I see.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Matt

Whatever is happening with the Simple Shape Shader would be a different issue. I don't know if there's a bug there - I haven't looked into that yet.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

If you have a pyramid with sharp edges like that, I would recommend setting the Surface Layer's displacement direction to Vertical, not Along Normal. The Compute Terrain and Compute Normal won't be able to create smooth normals from the pyramid, so it'll always look a bit off.
Just because milk is white doesn't mean that clouds are made of milk.

WASasquatch

Quote from: Matt on October 02, 2018, 11:42:28 pm
If you have a pyramid with sharp edges like that, I would recommend setting the Surface Layer's displacement direction to Vertical, not Along Normal. The Compute Terrain and Compute Normal won't be able to create smooth normals from the pyramid, so it'll always look a bit off.


Yeah, I figured the angles are too hard. Which is OK, it's hard to texture a pyramid like this anyway from terrain so best to use an object or something.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Dune

Thanks for your explanation and attention to this, Matt.