Sharp Edges Away from Camera Tears Terrain

Started by WAS, May 24, 2020, 06:54:18 pm

Previous topic - Next topic

WAS

I found this actually in a cliff project where I had the cliff really tight, but I actually thought it was because of my Vector Displacement warping, and so just moved past it with different settings.

However I'm working on some cracked mud shaders, and it's reappeared in a more controlled environment. Basically, any straight edge angle facing away from the camera creates line-tears towards the camera. On top of the line issue, shadows aren't working like the did before either with the geometry.

Example here is MPD 0.7 AA 6 SR but the same appears in PT at the same settings. This wasn't a issue with this same cracked shader that I used a long time ago for my dried pond with the bison skull, so it's appeared more recently. I can see what's creating it, there are weird jagged artifacts in the displacement calculation, which viewed directly are just little jagged marks, but when viewed away from the camera, tear through the terrain at the camera.

Is there a way to remedy this without insane render settings? This seems like a bug in approximation of edges. For example, if you have a perfectly straight edge on a planet, like from image based, you get nothing but streaks down the face, rather than a smooth face.

Matt

The micropolygons don't know how to align to your geometric shapes, so this is always going to happen to some extent. All you can do is mitigate it with higher micropoly detail and/or higher ray detail multiplier.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

Quote from: WAS on May 24, 2020, 06:54:18 pmit's appeared more recently.

I don't think that's true, but as I often say, you'd need to test old versions with the same scene file to confirm that.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

The hair-like shadows on the top faces look like they might be fixable though. Can you try some of the advanced options in Subdiv Settings?
Just because milk is white doesn't mean that clouds are made of milk.

WAS

You are probably right about the MPD (outside the tear lines) issue, but what I mean is the lines on the tops, only coming from the jagged shapes facing away from the camera are new. For example take my old pond, even back on freeware and my old PC. I'm sure this was MPD 0.4 - MPD 0.6 (as a max). AA was probably 6. https://planetside.co.uk/forums/index.php?action=dlattach;topic=24647.0;attach=82727;image

Same shader, though I have mixed the cracks mask with a tight and gapped version for realism. But the line tears towards the camera from lateral faces that are facing away from the camera aren't present. If this was exclusively just the MPD edge issue, it should be worse in this legacy image considering lower quality and resolution.

WAS

The MPD issue with edges can be "realistic" when fractal warping is applied and everything, but the lines coming inwards are always very straight and anomaly-esque looking.

WAS

Increasing RDM it didn't really help until reaching near or at 1, and even there doesn't fully stop the lines, while simultaneously nearly doubling render time.

Force edges didn't do anything and I tried a custom subdiv of 4096 and was no impact either. Seems just 0.9-1 on RDM is all there is but heavily hits render time, even before any real shading work.

Matt

Quote from: WAS on May 24, 2020, 07:33:10 pmYou are probably right about the MPD (outside the tear lines) issue, but what I mean is the lines on the tops, only coming from the jagged shapes facing away from the camera are new. For example take my old pond, even back on freeware and my old PC. I'm sure this was MPD 0.4 - MPD 0.6 (as a max). AA was probably 6. https://planetside.co.uk/forums/index.php?action=dlattach;topic=24647.0;attach=82727;image

Same shader, though I have mixed the cracks mask with a tight and gapped version for realism. But the line tears towards the camera from lateral faces that are facing away from the camera aren't present. If this was exclusively just the MPD edge issue, it should be worse in this legacy image considering lower quality and resolution.

Yeah, it does seem better in this render, I don't really see any hairline shadows.

I think it helps to reduce the depth of the cracks or make the edge softer, less sharp. That would be my advice here. The mixing you're doing in the old file probably helps to reduce the depth.

If the bug really is new, that's great because it'll be easier to fix. There are two ways to test this. Either (1) render one scene file in two versions of Terragen or (2) render two scene files in one version of Terragen. When the old render is a different scene file it might just be that the renderer handles the other scene file better, because there are dozens of variables to consider.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

I have some other ideas what might be causing the hairline shadows. Can you send me the TGD?
Just because milk is white doesn't mean that clouds are made of milk.

WAS

I started working on a new project (it actually has a lot less bloat in the project, just the shader I've completed so far) but it has the same issue, so I'll send that one.

You mentioned softer edges but this is something i haven't quite figured out. The voronoi scalar is just a slant to it's center point, so I've had trouble trying to figure out how to manipulate this to get anything other than hard slants. I tried clamps but because of the slant of the voronoi it doesn't seem to work right using softness, or maybe I just wasn't doing it right (setting wise).

By the way, you are right about less amplitude but that's unfortunate because I did want to do some variations of all deep cracked mud like you get IRL where it can be upwards half the foot deep.

Dune

You do use a smooth step instead of a color adjust in the voronoi setup?

WAS

Nor for the cracks no. The issue with that is than mixing them. You get different intensities (enter my other topic about measuring scalars) which of course miz differently and yield different displacement results. A gapped smooth step or soft clamp voronoi will be much taller (more intense) than a tightly clamped (tight cracks) voronoi. 

I wonder how I could go about normalizing these different intensities mathematically so it can scale proportionately with setting changes. I know I'd need to figure out min and Max scalar values to be accurate

Dune

I'd say they mix the same way, as it's just a softer replacement of a hard-edged color adjust, but I don't know your setup of course. I can imagine triangular (or any) surfaces/vertices being hard-bent over 90ยบ without any smoothness causing trouble. In modeling it is also always adviced to at least smooth hard edges a little, so I guess the same is true for TG. It would certainly be easier to have a color adjust with a tickbox for smooth 'clamps' anyway.

WAS

May 25, 2020, 02:31:46 am #13 Last Edit: May 25, 2020, 02:38:26 am by WAS
I tried soft steps, and soft min-max and they both have similar effects. Think about the voronoi, it's just a slant to the center of the plotting points. So if you want a large gap between voronoi, you'd need to create a smooth step / min max at about half-way between the base, and max of the voronoi. Think of that half-way point as your displacement (Y). Now if you want to do a tight crack, you don't need to travel up the slant very far, thus, your ending point is much lower than the gaped points, creating much less displacement. A way to normalize these needs to be figured out to be work with large or low displacements where any variance from accuracy would be accentuated.

Here is a example with Maximum and Minimum scalars with softness values to create "rounded" edges for the tops of the straight edges. Tight edged voronoi is lower than the gaped voronoi because of the end-point of the clamps maximum (Soft minimum scalar) is lower in the original scalar.

This does of course entirely solve my problem so I'm trying to get it to work.

Edit: Also, I tried using the mixed setup to create a simple cracks mask that I could than use to just do negative displacement on a constant scalar at 1 (to multiply by the final amplitude), but unfortunately, the mixer starts showing through in the scalar because of how faint the resulting scalars are after soft clamping and having to ramp up BW and WP to get a hard white mask.

Matt

You are clamping to some value already, so perhaps you could clamp with a Smooth Step Scalar instead.
Just because milk is white doesn't mean that clouds are made of milk.