Surface Layer Smoothing Effect with Patchsize at and exceeding 20

Started by WAS, May 21, 2021, 06:47:48 PM

Previous topic - Next topic

WAS

The smoothing effect seams to be creating erroneous peaks around the boundaries of smoothing effect surface layers when the patch size is too large (eventually for large intersection texturing).

It's even noticeable with just the default patch size of 20, where the offset of this smooth area is only 0.25 but at great distance on the mountain we can see roughness into a meter or more.

WAS

Probably should note, this is 4.5.56 SR didn't try PT as I didn't think it'd matter.

WAS

If anyone knows a way to prevent this I'd be interested to know, as I had a nice snow scene that works well for the snow parts up close but is disastrous at a distance for the mountain. I tried displacement tolerance but that didn't work. I also tried mixing the terrains with masks but was having boundary texture issues in my first attempt that looked very bad.

Dune


WAS

As for your comment on my Terror Bird thread about the renderer having issues calculating the smooth areas. You'd think this would just be a mask based on what the surface layer is covering, and would act like such. Similar to just masking a surface layer. But culling displacement along the fuzzy zone to where the surface layers density is 1.

But with this causing an issue with event he default patch size, in a default scene, I'd say it's a bug that should see improvement. I've never really used the feature because I was told to do it with Fake Stones, but noticed it broke stones worse, which may have actually been this bug. But for sprawling terrains, and texturing, this is very much buggy and not usable.

Dune

A patch will have an average sort of altitude, so I can imagine if you then smooth by a smaller PF, not all areas are smoothed the same way, hence the strange displacements. But does it occur only in the distance like in your sample? Then a distance shader might help to mask that out.

WAS

The issue is the smoothing effect is incorporated into the distant texturing work, smoothing out rough areas to apply smooth rolling snow on the mountain.

It is one of its uses, and shouldn't be limited to the immediate foreground imo. It even causes issues as mentioned with just the default patch size of 20.

These patch sizes are pretty crucial for intersection texturing. As too small, and it's adhering to small displacement vs larger (with smaller integers).

Dune

Still, if you mask smoothing by a fractal with minimum size of 10cm you could get in trouble. I would set this up in layers I guess, with the smaller masks only in front areas. There's a sweet spot around 50-100 patch, but that depends on terrain, I think. Higher and it gets really spikey. And, as said, when you check smooth surface, it's working nicely.

For really smooth snow, you should take out the fractal warp too, as that doesn't react fully on smoothing. Better mask that in later.

WAS

Don't think it's related, Ulco. As you can go ahead and apply a distance shader, or mix in two maps with a smoothing effect into 20+ and still a issue. Now you can just plainly see that the displacement 0.25 of the PF being smoothed is now reaching 20-30+ meters, then being smoothed. Seems to be something entirely different in computation with the compute terrain.

Seems to be that displacement shaders added after the Compute Terrain do not follow their settings constraints at a distance, and start doing weird stuff, like gaining ridiculous excessive offsetted displacement.

Dune

So you must find a workaround ;)  Not everything is perfect, I'm afraid.

WAS

Or, there is a clear bug with distant displacement and the smoothing feature.

The shader doesn't state we can only use it in the foreground, because the sampler goes nuts. Lol

Quit just shrugging off stuff like this, Ulco. You don't help TG look good... The contrary...

It seems obvious to me that either displacement at a distance isn't following it's settings right, at all, or the smoothing effect is causing the issue with excessive displacement gain. With the first scenario this can literally be an obstacle for normal terrain work and create undesirable effects at a distance. With the second, it breaks the use of a shader to exclusively use it in the foreground... Both of these scenarios aren't very good... Finding "another way" is implied. Doesn't mean there isn't an issue...

Dune

Well, you may be right about the bug, but I just don't have too much time to worry about this now, hence my 'shrugging off'. I still think if you mask a 'to be smoothed' area by small detail, you're bound to get weird artifacts. Not in the front, because the initial displacement is tiny or absent, but as soon as terrain goes up or down, these mismatches with computed terrain may play havoc (because of the mask).
Too smooth out certain smaller displacements like you have in front, I would always use an XYZ shader after the big displacements to 'fix' the big ground. The compute terrain has a certain patch size to consider (and slows down), hence my choice. Any added smaller displacement after that can be smoothed by whatever, and not affect the mountains over yonder. Maybe that's a 'workaround'?

WAS

But. Again. Patch size doesn't matter. Could be default, lower, or ridiculously high. The issue is always there. Also doesn't matter if the mask is low octave or high, small or large scale.... Again issue with disp is still there.

I am thinking its the sampler and dynamic polygon settings that cull detail at distance, and are not following the laws of the shaders applied at a distance. Such as growing 30+ meters above computed displacement from a PF with 0.25m displacement...

And you may not have the time to worry, but I do believe this is support for staff/development. But at the same time definitely doesn't give me confidence for the alpha program, and kinda reaffirms my opinions on why so many bugs get through cause alpha tests aren't really testing and straining TG to discover bugs. Beta/alpha testers should be trying to break the program (sarcasm). :P least from my years at Xbox beta testing and software testing.

Gotta say though, no staff or dev (Matt) responding to support topics or selectively approaching them is a bit annoying.

Matt

Hi Jordan,

"Smoothing effect" in the Surface Layer reverts the surface back to a smoother version of the most recent Compute Terrain or Tex Coords from XYZ. The larger the patch size, the larger the difference is likely to be.

In your scene the issue is caused by the mask you are applying to the surface layer. The mask has some very high frequency (small scale) and high contrast components, and these are causing the surface to rapidly switch between the smoothed and non-smoothed surfaces. I don't think there's a bug here, just a particular combination of shaders producing an unwanted result.

One way you might be able to resolve this is to reduce the roughness of the masking fractal.

EDIT: The mask's "feature scale" is currently 5, and this will need to be much higher if you don't want spikes. It probably needs to be at least as large as the patch size.

EDIT 2: You can increase the sharpness of the mask's effect on colour only by reducing "Fuzzy zone softness" on the Effects tab. When it's set to 1, the colour and displacement use the same mark sharpness. The idea is that you use low contrast (or low frequency) masks so that they don't create spikey displacements, and then lower the "Fuzzy zone softness" (e.g. 0.1 or 0.01) to bring out some sharpness on the for colour/shading only.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Quote from: Matt on May 27, 2021, 04:41:33 PMHi Jordan,

"Smoothing effect" in the Surface Layer reverts the surface back to a smoother version of the most recent Compute Terrain or Tex Coords from XYZ. The larger the patch size, the larger the difference is likely to be.

In your scene the issue is caused by the mask you are applying to the surface layer. The mask has some very high frequency (small scale) and high contrast components, and these are causing the surface to rapidly switch between the smoothed and non-smoothed surfaces. I don't think there's a bug here, just a particular combination of shaders producing an unwanted result.

One way you might be able to resolve this is to reduce the roughness of the masking fractal.

EDIT: The mask's "feature scale" is currently 5, and this will need to be much higher if you don't want spikes. It probably needs to be at least as large as the patch size.


I have tried large scales, low actives, high octaves. I stated this, and explained the actual issue being exaggerated by the mask

The issue is not the smooth layer but what is happening with shaders applied after the compute terrain.

The tiny stones, and tiny displaced PF should not be gaining displacement extents in excess of 30 meters. Where is this nonsense coming from defying the  laws of the shader settings?

This is where the smoothing layer is producing bad effects, because reverting to the Compute Terrain is revealing a bug in how displacement is being handled at a distance from the PF (displacement PF not mask PF of smoothing layer).