Normal hard weird edges

Use this forum for general user support and related questions.
Post Reply
kumaran7
Posts: 26
Joined: Mon May 21, 2018 5:48 pm

Normal hard weird edges

Post by kumaran7 » Sun Apr 28, 2019 1:52 am

Hard edges in normal map.how can i fix this problem.
Attachments
lux bug.jpg

User avatar
Dade
Developer
Developer
Posts: 2807
Joined: Mon Dec 04, 2017 8:36 pm

Re: Normal hard weird edges

Post by Dade » Sun Apr 28, 2019 7:51 am

Can you post the scene ?
Support LuxCoreRender project with salts and bounties

wasd
Posts: 217
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd » Sun Apr 28, 2019 12:16 pm

My wild guess is that normal map doesn't respect Phong normals. So, Phong normal should be calculated first, then normal from map added. But it seems (I didn't read the actual code) that normal map added to surface normal, ignoring Phong interpolation.

Here's my example scene
bump_terminator-c.blend
(2.79 MiB) Downloaded 17 times
CPU Bidir + Metropolis | Log Power | Core i5-4570

kintuX
Posts: 433
Joined: Wed Jan 10, 2018 2:37 am

Re: Normal hard weird edges

Post by kintuX » Sun Apr 28, 2019 3:59 pm

Use Normal Height value below 3 cm = 0.03.
eg. h = 3cm / without Subdivision, as you can observe artifact starts appearing ;)
bump_terminator-c@3cm(=0.003).jpg

wasd
Posts: 217
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd » Sun Apr 28, 2019 5:56 pm

kintuX wrote:
Sun Apr 28, 2019 3:59 pm
Use Normal Height value below 3 cm = 0.03.
eg. h = 3cm / without Subdivision, as you can observe artifact starts appearing ;)

bump_terminator-c@3cm(=0.003).jpg
1.) As far as I know normal "Height" is not in meters, it's 0-100%. At 0 it's no change to initial normal; at 1 it's 100% added map value.
2.) My guess must be wrong, because at 0 Height the surface is smoothed.

No normal map, flat
no1.png
~
No normal map, smoothed
no2.png
~
Yes normal map, Height = 0
no3.png
~
Yes normal map, Height = 1
no4.png
~

3.) My another observation: it's the same faces that experience terminator problem are affected by the "normal map problem". Faces affected by terminator problem has sharp edges, but smoothed at the middle. With normal map they look flat.

Normal map
t1.png
Terminator
t2.png
File with cylinder
bump_terminator-d.blend
(2.84 MiB) Downloaded 15 times
4.) My another wild guess is that the problem lies somewhere in clipping combined normals.
CPU Bidir + Metropolis | Log Power | Core i5-4570

wasd
Posts: 217
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd » Wed May 01, 2019 12:09 pm

Normal map Height = 2.45
buk4.png
~
No bump
buk2.png
~
Normal map Height = 0.3
buk3.png
~

https://github.com/LuxCoreRender/LuxCor ... malmap.cpp

Code: Select all

// Transform n from tangent to object space
	Normal shadeN = Normal(Normalize(hitPoint.GetFrame().ToWorld(n)));
	shadeN *= (Dot(oldShadeN, shadeN) < 0.f) ? -1.f : 1.f;
If normal is pointing wrong way it is reversed?
CPU Bidir + Metropolis | Log Power | Core i5-4570

User avatar
Dade
Developer
Developer
Posts: 2807
Joined: Mon Dec 04, 2017 8:36 pm

Re: Normal hard weird edges

Post by Dade » Wed May 01, 2019 2:12 pm

wasd wrote:
Wed May 01, 2019 12:09 pm
Normal map Height = 2.45
kintuX wrote:
Sun Apr 28, 2019 3:59 pm
Use Normal Height value below 3 cm = 0.03.
Support LuxCoreRender project with salts and bounties

wasd
Posts: 217
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd » Wed May 01, 2019 3:57 pm

Dade wrote:
Wed May 01, 2019 2:12 pm
wasd wrote:
Wed May 01, 2019 12:09 pm
Normal map Height = 2.45
kintuX wrote:
Sun Apr 28, 2019 3:59 pm
Use Normal Height value below 3 cm = 0.03.
It's not 3 cm though.

When normal is pointing outward the camera is should be clipped at near perpendicular, not inverted.
Setting so-called "Height" multiplier doesn't solve anything.
CPU Bidir + Metropolis | Log Power | Core i5-4570

Post Reply