Direct Light cache: hit rate not good

Use this forum for general user support and related questions.
marcatore
Posts: 84
Joined: Wed Jan 10, 2018 8:04 am

Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 8:19 am

I'm testing the new light strategy.

I got this warning in the log:

[LuxCore][4031.706] WARNING: direct light sampling cache hit rate is not good en
ough: 80.2728%

What should I do to increase the hit rate?

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

Re: Direct Light cache: hit rate not good

Post by Dade » Mon Jul 02, 2018 8:30 am

marcatore wrote:
Mon Jul 02, 2018 8:19 am
I'm testing the new light strategy.

I got this warning in the log:

[LuxCore][4031.706] WARNING: direct light sampling cache hit rate is not good en
ough: 80.2728%

What should I do to increase the hit rate?
The code will add entries, to the cache up, to when the threshold hit rate (lightstrategy.targetcachehitratio, default 99.5%) is met or the maximum samples count is reached (lightstrategy.maxsamplescount, default 10,000,000).

So he most direct way to increase the cache hit rate (by increasing the number of cache entries) is to increase the maximum samples count.

There few other less direct (on more debatable) ways:

- decrease the max. path depth (lightstrategy.maxdepth, default 4);

- increase the cache entry radius (lightstrategy.entry.radius, default 0.15);

Are you rendering an open scene ? Can you post a rendering of the scene to have an idea of what we are talking about ?
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 9:46 am

"Are you rendering an open scene ? Can you post a rendering of the scene to have an idea of what we are talking about ?"

The scene is this
01.jpg
Completed in 7m23sec

Some reports with this scene:
- 82 area lights from the lights projector + sun outside
- the default cache samples number is probably too high because it calculate cache forever...it's really really slow and after 15 minutes I closed blender. That image is rendered with 6000 max samples and it took about 3 minutes to calculate lightcache.
- I've also decreased the max depth to 1.
- the entry radius is 30cm
- I haven't touched any other lightcache setting
- I'm using CPU path render with total depth of 10, diffuse 10, glossy 10 and specular 10
- Output clamped to 1500
- Sampler to Sobol with 0.7 as adaptive strenght
- Rendering Halt condition 150 samples


This is the same scene, just with Log Power instead Direct Lightcache
02.jpg
completed in 3min39sec

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

Re: Direct Light cache: hit rate not good

Post by Dade » Mon Jul 02, 2018 10:16 am

marcatore wrote:
Mon Jul 02, 2018 9:46 am
- 82 area lights from the lights projector + sun outside
Your area lights are made of how many triangles ?
marcatore wrote:
Mon Jul 02, 2018 9:46 am
- the default cache samples number is probably too high because it calculate cache forever...it's really really slow and after 15 minutes I closed blender. That image is rendered with 6000 max samples and it took about 3 minutes to calculate lightcache.
Your light cache is likely to be nearly empty. There is a lot of space between 6,000 and 10,000,0000.

But if you are getting a 3min pre-processing for 6,000 samples, there must be something wrong, what CPU do you have ? Windows ?
marcatore wrote:
Mon Jul 02, 2018 9:46 am
- I've also decreased the max depth to 1.
It is too small, try 3 or just use the default value 4.

Note: I have the feeling, your scene is lighted only by sun + indirect illumination, can you try the same test without the sun ?
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by Dade » Mon Jul 02, 2018 10:17 am

BTW, for testing purpose, you can also do the rendering with direct light only (i.e. setting the PATHCPU max. depth to 1).
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 10:57 am

Area lights are the standard Blender "area light" object. I don't know how many triangles has, I imagine it's a simple plane, so it should be 2 triangles.

My CPU is Xeon E5-1650 v3 @ 3.5Ghz, 16Gb Ram. Windows 7 64bit

This is a render without sun&sky and with path depths set to 1 (total depth, diffuse, glossy and specular to 1)
03.jpg

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

Re: Direct Light cache: hit rate not good

Post by Dade » Mon Jul 02, 2018 11:28 am

marcatore wrote:
Mon Jul 02, 2018 10:57 am
This is a render without sun&sky and with path depths set to 1 (total depth, diffuse, glossy and specular to 1)
But how is the difference between cache On Vs. Off in this case ?

The "circles" and "the dirty patches" (i.e. high noise) you see on some wall, is exactly the result of "not enough cache entries".
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 12:19 pm

When do you ask me about "the difference", are you speaking visual difference or in term of rendertimes?

In any case, about visual, this is the same render with Log Power light strategy.
04.jpg

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

Re: Direct Light cache: hit rate not good

Post by Dade » 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 ?
Support LuxCoreRender project with salts and bounties

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

Re: Direct Light cache: hit rate not good

Post by marcatore » Mon Jul 02, 2018 1:49 pm

Yes. I'm still using 6000.

And actually the direct lighting has a lot less noise

About the few samples I'm using...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). Have you got an idea about this?
Last edited by marcatore on Mon Jul 02, 2018 1:53 pm, edited 1 time in total.

Post Reply