Normal hard weird edges

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
kumaran7
Posts: 37
Joined: Mon May 21, 2018 5:48 pm

Normal hard weird edges

Post by kumaran7 »

Hard edges in normal map.how can i fix this problem.
Attachments
lux bug.jpg
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Normal hard weird edges

Post by Dade »

Can you post the scene ?
Support LuxCoreRender project with salts and bounties
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd »

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 146 times
CPU Bidir + Metropolis | Core i5-4570
kintuX
Posts: 810
Joined: Wed Jan 10, 2018 2:37 am

Re: Normal hard weird edges

Post by kintuX »

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: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd »

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 145 times
4.) My another wild guess is that the problem lies somewhere in clipping combined normals.
CPU Bidir + Metropolis | Core i5-4570
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd »

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 | Core i5-4570
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Normal hard weird edges

Post by Dade »

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: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Normal hard weird edges

Post by wasd »

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 | Core i5-4570
Post Reply