Shadow Terminator problem

Discussion related to the Engine functionality, implementations and API.
Post Reply
User avatar
Dade
Developer
Developer
Posts: 3249
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Shadow Terminator problem

Post by Dade » Wed Aug 07, 2019 9:20 am

Introduction

This was the starting point in a quite extreme case:

old.jpg

Fixing a couple of problems

As first step I have fixed 2 problems:

1) the self-shadow problem in 2 triangles with a glancing angle with the light source (i.e. see the noise due to some self-intersection of shadow rays);
2) the horrible bounce back of light intensity on the edge.

and the result is:

new1.jpg

Note: the black triangles on the edge are unavoidable, their geometric normal points away from the light source so there is no way to fix them aside increasing tessellation and/or using softer shadows (due to a larger light source, etc.).

"Taming the Shadow Terminator" ... when using bump/normal mapping

This is another test:

bump-plain.jpg

Now look what happen if I add bump mapping:

bump-old.jpg

Lights magically appears from no where and start to illuminate also over the shadow termination. This is what

"Taming the Shadow Terminator"
by Matt Jen-Yuan Chiang, Yining Karl Li and Brent Burley

https://www.yiningkarlli.com/projects/s ... nator.html

can fix. This is the same rendering using the shadow terminator avoidance factor described in the paper:

bump-new.jpg

Better, now the renderings with and without bump mapping match each other.

P.S. this code is not part of beta3 but only available in daily builds.
Support LuxCoreRender project with salts and bounties

User avatar
lacilaci
Donor
Donor
Posts: 1637
Joined: Fri May 04, 2018 5:16 am

Re: Shadow Terminator problem

Post by lacilaci » Wed Aug 07, 2019 9:46 am

Wow, never realized that the original shading was so insane! :D

Can't wait to test

EDIT:

Not being part of beta3 means I won't be able to use it in the build for 2.8 that Simon is preparing?

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2997
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Shadow Terminator problem

Post by B.Y.O.B. » Wed Aug 07, 2019 10:29 am

Hi, great work, this is definitely an improvement (although I still dream of a fix like in Thea render).

However, I have a scene here that shows some regressions.
Files attached.
lacilaci wrote:
Wed Aug 07, 2019 9:46 am
Not being part of beta3 means I won't be able to use it in the build for 2.8 that Simon is preparing?
I would include it if there were no regresssions.
Attachments
New
New
Old
Old
smooth_shade_test.zip
(759.03 KiB) Downloaded 16 times
Support LuxCoreRender project with salts and bounties

User avatar
FarbigeWelt
Donor
Donor
Posts: 869
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Shadow Terminator problem

Post by FarbigeWelt » Wed Aug 07, 2019 11:30 am

B.Y.O.B. wrote:
Wed Aug 07, 2019 10:29 am
Hi, great work, this is definitely an improvement (although I still dream of a fix like in Thea render).

However, I have a scene here that shows some regressions.
Files attached.
lacilaci wrote:
Wed Aug 07, 2019 9:46 am
Not being part of beta3 means I won't be able to use it in the build for 2.8 that Simon is preparing?
I would include it if there were no regresssions.
What regressions do you mean? The ‚spheres‘ look better overall in the New than in the Old.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

User avatar
FarbigeWelt
Donor
Donor
Posts: 869
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Shadow Terminator problem

Post by FarbigeWelt » Wed Aug 07, 2019 11:34 am

Finally, I can finish the crescent moon I started over a half year ago. 8-)
Great work, Dade! And thank you for the nice introduction.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2997
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Shadow Terminator problem

Post by B.Y.O.B. » Wed Aug 07, 2019 12:17 pm

FarbigeWelt wrote:
Wed Aug 07, 2019 11:30 am
What regressions do you mean?
Flip between the images and look at the right side. The ground plane (flat shaded) shows some very weird tiled shadowing artifacts with the new code.
Support LuxCoreRender project with salts and bounties

User avatar
lacilaci
Donor
Donor
Posts: 1637
Joined: Fri May 04, 2018 5:16 am

Re: Shadow Terminator problem

Post by lacilaci » Wed Aug 07, 2019 2:35 pm

So aside some shading issues which B.Y.O.B reported already, this is really really cool.

Even hard sunlight is handled well without going into crazy polycounts!!!
shadowTM.jpg

User avatar
Dade
Developer
Developer
Posts: 3249
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow Terminator problem

Post by Dade » Wed Aug 07, 2019 2:37 pm

B.Y.O.B. wrote:
Wed Aug 07, 2019 10:29 am
However, I have a scene here that shows some regressions.
I should have fixed this problem:

ok.jpg
Support LuxCoreRender project with salts and bounties

User avatar
FarbigeWelt
Donor
Donor
Posts: 869
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Shadow Terminator problem

Post by FarbigeWelt » Wed Aug 07, 2019 4:16 pm

Dade wrote:
Wed Aug 07, 2019 2:37 pm
B.Y.O.B. wrote:
Wed Aug 07, 2019 10:29 am
However, I have a scene here that shows some regressions.
I should have fixed this problem:


ok.jpg
This tops everything! That is perfect! Congratulations! 🍾
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

User avatar
Sharlybg
Donor
Donor
Posts: 1525
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Shadow Terminator problem

Post by Sharlybg » Wed Aug 07, 2019 6:37 pm

What a time to be alive. Thanks you so much ;)
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

Post Reply