Direct Light cache: hit rate not good

Use this forum for general user support and related questions.
User avatar
Sharlybg
Supporting Users
Posts: 684
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Direct Light cache: hit rate not good

Post by Sharlybg » Mon Jul 02, 2018 1:51 pm

Dade wrote:
Mon Jul 02, 2018 1:45 pm
marcatore wrote:
Mon Jul 02, 2018 12:19 pm
In any case, about visual, this is the same render with Log Power light strategy.
The difference is huge as expected but you are still using only 6,000 samples, right ?
Maybe will be good to have some explanation of DLCS setting !
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by B.Y.O.B. » Mon Jul 02, 2018 2:18 pm

Sharlybg wrote:
Mon Jul 02, 2018 1:51 pm
Maybe will be good to have some explanation of DLCS setting !
Yes, like always we have to do the following:
  • Find out which properties actually need to be exposed to the users
  • Add descriptions (tooltips) and sensible min/max values for those properties
For the descriptions I will need help from Dade.
it seems you're quite surprised to see that I can use only so few samples (and I'm surprised too considering that the default is quite higher).
You seem to assume that a sample in the direct light cache is as expensive to compute as a sample in the final render process.
This is not the case. The situation is similar to the visibility map precomputation, it uses 1,000,000 samples by default and this number is not even exposed in BlendLuxCore because it works so well and the samples are computed so fast (often in under 1 second).
Support LuxCoreRender project with salts and bounties

marcatore
Posts: 98
Joined: Wed Jan 10, 2018 8:04 am

Re: Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 3:28 pm

B.Y.O.B. wrote:
Mon Jul 02, 2018 2:18 pm
You seem to assume that a sample in the direct light cache is as expensive to compute as a sample in the final render process.
This is not the case. The situation is similar to the visibility map precomputation, it uses 1,000,000 samples by default and this number is not even exposed in BlendLuxCore because it works so well and the samples are computed so fast (often in under 1 second).
I've tested... reset all the lightcache to the default values.
Lightcache computing time about 16min.
It seems quite far from the "seconds" I've read until now. I'm just assuming that there is, at least, something strange is going on.

this is final image
05.jpg

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

Re: Direct Light cache: hit rate not good

Post by B.Y.O.B. » Mon Jul 02, 2018 3:45 pm

marcatore wrote:
Mon Jul 02, 2018 3:28 pm
Lightcache computing time about 16min.
It seems quite far from the "seconds" I've read until now. I'm just assuming that there is, at least, something strange is going on.
In the few tests I did so far with DLSC it either finished very quickly or it took so long that I cancelled it. I am also a bit at a loss which options to tweak to get faster build times with almost equal cache quality. It is a bit like learning to control a new render engine :)
I hope Dade can help us understand the parameters better.

I also noticed that the "building cache entries" phase is running singlethreaded with my LuxCore builds. Is that intended, or a leftover from testing (commented #pragma omp?) or is my build incorrect?

marcatore, maybe you can upload your testscene so we can do our own tests with it?
Or link to it, if nothing has changed since you last uploaded it?
Support LuxCoreRender project with salts and bounties

marcatore
Posts: 98
Joined: Wed Jan 10, 2018 8:04 am

Re: Direct Light cache: hit rate not good

Post by marcatore » Tue Jul 03, 2018 6:56 am

@B.Y.O.B. and @Dade
Here the scene.

https://we.tl/i8YMaVBige

I hope you'll find what's wrong.
If you have any other test i should do, write me

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

Re: Direct Light cache: hit rate not good

Post by B.Y.O.B. » Tue Jul 03, 2018 8:38 am

Here's a render with all values left on default, except the radius which I raised to 1m.
Calculating the cache took 8min 30sec, rendering to 150 samples took 4min 20sec.
Attachments
dlsc_marcatore_test_01_radius1m.png
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by Dade » Wed Jul 04, 2018 9:59 am

DLSC has pre-processing has 3 steps:

1) select where to place the cache entries (single thread)
2) select the list of visible light sources (and how much they are visible) for each cache entry (multi-thread)
3) share information between near cache entries to avoid artifacts with hard shadows (multi-thread)

#1 only takes few secs while #2 seems very slow with this scene:

Code: Select all

[LuxCore][3.933] Building direct light sampling cache
[LuxCore][3.933] Building direct light sampling cache: building cache entries
[LuxCore][5.933] Direct light sampling cache entries: 375042/10000000 (3%)
[LuxCore][5.933] Direct light sampling cache hits: 1327092/1349141 (98.3657%)
[LuxCore][7.933] Direct light sampling cache entries: 770168/10000000 (7%)
[LuxCore][7.933] Direct light sampling cache hits: 2744101/2770328 (99.0533%)
[LuxCore][9.933] Direct light sampling cache entries: 1167023/10000000 (11%)
[LuxCore][9.933] Direct light sampling cache hits: 4169213/4197850 (99.3178%)
[LuxCore][11.933] Direct light sampling cache entries: 1563408/10000000 (15%)
[LuxCore][11.933] Direct light sampling cache hits: 5592847/5623188 (99.4604%)
[LuxCore][12.720] Direct light sampling cache hit is greater than: 99.5000%
[LuxCore][12.720] Direct light sampling cache total entries: 30933
[LuxCore][12.720] Building direct light sampling cache: filling cache entries
[LuxCore][14.943] Direct light sampling cache filled entries: 66/30933 (0%)
[LuxCore][17.229] Direct light sampling cache filled entries: 146/30933 (0%)
[LuxCore][19.356] Direct light sampling cache filled entries: 214/30933 (0%)
[LuxCore][21.383] Direct light sampling cache filled entries: 283/30933 (0%)
[LuxCore][23.471] Direct light sampling cache filled entries: 346/30933 (1%)
[LuxCore][25.863] Direct light sampling cache filled entries: 427/30933 (1%)
[LuxCore][27.871] Direct light sampling cache filled entries: 494/30933 (1%)
[LuxCore][30.215] Direct light sampling cache filled entries: 569/30933 (1%)
[LuxCore][32.402] Direct light sampling cache filled entries: 637/30933 (2%)
[LuxCore][34.405] Direct light sampling cache filled entries: 704/30933 (2%)
[LuxCore][36.540] Direct light sampling cache filled entries: 769/30933 (2%)
[LuxCore][38.813] Direct light sampling cache filled entries: 843/30933 (2%)
[LuxCore][40.834] Direct light sampling cache filled entries: 902/30933 (2%)
[LuxCore][43.076] Direct light sampling cache filled entries: 974/30933 (3%)
[LuxCore][45.240] Direct light sampling cache filled entries: 1039/30933 (3%)
[LuxCore][47.646] Direct light sampling cache filled entries: 1114/30933 (3%)
[LuxCore][49.655] Direct light sampling cache filled entries: 1177/30933 (3%)
[LuxCore][52.056] Direct light sampling cache filled entries: 1251/30933 (4%)
[LuxCore][54.271] Direct light sampling cache filled entries: 1315/30933 (4%)
[LuxCore][56.731] Direct light sampling cache filled entries: 1397/30933 (4%)
[LuxCore][59.192] Direct light sampling cache filled entries: 1475/30933 (4%)
[LuxCore][61.308] Direct light sampling cache filled entries: 1542/30933 (4%)
[LuxCore][63.539] Direct light sampling cache filled entries: 1622/30933 (5%)
Going to check what is going on.
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by Dade » Wed Jul 04, 2018 3:46 pm

I looked into the scene and it includes 8366 light sources (!), each light source is made of 100+2 triangles. I'm not sure if they are modeled as cylinders or whatever but it is just an huge overkill. They have to be replaced with a spot lights, a IES light or at least with a 2xTriangles light sources.

Once done, the pre-processing phase will be exactly 100 times faster.

I'm working on some change to accelerate the process but if you have to establish the visibility of 8366 light source for each cache entry, there isn't very much it can be done to shorten the time.
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by B.Y.O.B. » Wed Jul 04, 2018 8:33 pm

Dade wrote:
Wed Jul 04, 2018 3:46 pm
I looked into the scene and it includes 8366 light sources (!)
Thanks for pointing out the main problem.
If I disconnect the emission node in the "luce_faretto"-material, the light cache is built in 23 seconds and the 150 samples are reached after a total 3min 30sec (export + light cache + render time):
Attachments
scrn_2018-07-04_22-32-41.png
Support LuxCoreRender project with salts and bounties

marcatore
Posts: 98
Joined: Wed Jan 10, 2018 8:04 am

Re: Direct Light cache: hit rate not good

Post by marcatore » Thu Jul 05, 2018 6:37 am

Great guys!
I'm sorry but I've forgot that the light fixtures have an emission material.

I've tested using a matte material and it works in a great way!!!

Thank you very much

Total render time 2min13sec

Post Reply