Karma shading smooth surfaces

   2107   21   1
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Not sure what's going on here. Even with slightly smoothed normals I get this very odd white transition line at the start of the shadow area. Only when blurring the normals into oblivion, I end up with an acceptable transition from lighted to shadowed areas. Totally unacceptable shading result. 20.625 and standard surface shader. Distant light, but point and area lights deliver the same results. How can I avoid this? Is this a bug?

Cheers
Tom

Attachments:
a.jpg (157.3 KB)
b.jpg (143.0 KB)

User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
P.S.: Also remeshed this area with triangles of the same size. No difference.


And it's not related to coat or specular. It's in the diffuse part. Diffuse roughness doesn't make it disappear.
Edited by Tom Mangold - Aug. 22, 2024 18:40:57
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
P.P.S.: Tried out all other bsdf shaders with Karma CPU, additonally to standard shader with XPU. Same result. It's even visible in the opengl display shader. Normals are correct. Still looks wrong. : /
User Avatar
Member
334 posts
Joined: Nov. 2013
Offline
Are you able to post the geo in your screengrab there?
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Here you go. It's clearly the transition area between curved to rounded. 20.0.625.

Attachments:
shading.hiplc (3.2 MB)

User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Changed the light angle slightly. Now it's even more visible.

What's even more odd is the shadow transition area. It feels like an edge bevel. Not like a smooth surface transition.

While somebody might be able to prove that this is mathematically correct, it just doesn't feel right and looks wrong.

Attachments:
shading_2.hiplc (3.2 MB)

User Avatar
Member
48 posts
Joined: Aug. 2014
Offline
Have you tried it in any other renderers? Looks like pretty standard shading to me... you'll notice sudden rate-of-curvature-changes like you have in the geometry here when you use a pure flat-colour shader. Not sure exactly how to apply the correct mathematical terms, but you'd want a smooth first-order-derivative of curvature (or something like that) to not spot the hint of discontinuity in the shading. That's essentially what you're getting if you blur the normals - you're smoothing over the rate-of-change.

It doesn't feel right, and looks wrong, but that's what you get when you switch from an arc to a dead-straight line, even if the tangent at the end of the arc matches the line. If you model in low poly and subdiv it all, you tend to avoid this look, because it'll naturally apply geometric falloff to such transitions, or you can just do what you've done, and blur the normals. You could even get clever and analyse the curvature, detect "edges" in the curvature values, and use those to selectively blur the normals...
Dan Wood
Vortex VFX Ltd
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Yeah, tried RS. Looks the same. The weird shadow transition - looks like an "even" grey part between light and shadow - is one thing, but the bright line shouldn't be there.

I can only imagine that shading and shadowing somehow add oddly up together in such a way, that the impression of the line appears. Very annoying subject and blurring needs to be quite high. Strength of 8 - 16 won't do. More like 500 - 1000, but this destroys the shape in many areas.

I'll give your curvature tip a go and see if this helps in any way. Thx for your thoughts.


P.S.: Tried out every setting in the renderer. Thought bias could make a difference, but it seems like it is not.
User Avatar
Member
334 posts
Joined: Nov. 2013
Offline
Like you said already there is no bright line (the pixel inspector doesn't report brighter pixels in that region) - your eye/brain is inventing it, making the discontinuous rate of change (derivative) in the normals along the seam more apparent than it really is. Bluring N is a reasonable way to go if you're unable to model the geometry with fewer polygons or as a subdivision surface.
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
That's something I considered, too. That the brain somehow emphasizes something which isn't actually there. On the other hand in "reality" I never came across this effect. That's probably why my brain is irritated by the shading.
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Since it's a CAD file, partially remeshed, subdivisions are not an option, since they don't take the normals into account and just don't work with this geo.
User Avatar
Member
334 posts
Joined: Nov. 2013
Offline
It's pretty much the same issue noticeable with basic linear gradients. In the picture below your eye emphasizes the area where the gradient starts.

Edited by antc - Aug. 23, 2024 11:00:52

Attachments:
gradient.png (568 bytes)

User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
My biggest enemy in Nuke: gradients. Visually unusable. ; )
User Avatar
Member
334 posts
Joined: Nov. 2013
Offline
Here's another strategy that gets nicer topology and reliant on subdivision for normals, rather than averaging.

Attachments:
shading_3.hipnc (3.2 MB)

User Avatar
Member
8037 posts
Joined: Sept. 2011
Offline
Tom Mangold
My biggest enemy in Nuke: gradients. Visually unusable. ; )

Have you tried not using your Visual Cortex?
User Avatar
Member
100 posts
Joined: Jan. 2015
Offline
To me the original surface continuity is not ideal if you expect a smooth gradient. It's probably something you want to 'fix' in your CAD software, as they are usually multiple tools to rebuild a surface and analyze the curvature.
Edited by PaQ WaK - Aug. 23, 2024 18:21:07

Attachments:
Derivation.JPG (61.0 KB)

Gameloft
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
Thanks for the additional input.

Not sure how you projected the pattern. But if you look at the first mesh wireshaded you should see that it's "perfect". Straight lines which then go into a perfect half circle. So this pattern shouldn't be possible with the first mesh.

Just did it myself. The regular geo looks fine.
User Avatar
Member
138 posts
Joined: Nov. 2017
Offline
jsmack
Tom Mangold
My biggest enemy in Nuke: gradients. Visually unusable. ; )

Have you tried not using your Visual Cortex?

Lol!
User Avatar
Member
100 posts
Joined: Jan. 2015
Offline
Hello, I'm using a simple zebra matcap.

It is possible my input is irrelevant tho and that I don't exactly understand your concern.
I have the feeling you expect here to have the surface looking like it was a single spherical trim, while in 'reality' there is a strong continuity variation.

Attachments:
GIF 8-24-2024 12-20-08 PM.gif (3.6 MB)

Gameloft
User Avatar
Member
2126 posts
Joined: Sept. 2015
Offline
Tom Mangold
But if you look at the first mesh wireshaded you should see that it's "perfect".


Actually it's not 'perfect' - there is a difference of tangency where the curve parts and straight parts meet.

In order to lessen that quick transition there would have to be a gradual curving of the straight parts sooner.

A remeshing wouldn't change that even if you could.

If you really wanted to change it geometry wise, you would have to return to the original and remodel, introducing that curving sooner and more gradually. Or, just remodel in houdini using the existing geo as a base to work from.

Attachments:
NonTangency.jpg (961.8 KB)
Tangency_Testing.hiplc (3.0 MB)

  • Quick Links