PhotonGI cache

Discussion related to the Engine functionality, implementations and API.
User avatar
lacilaci
Donor
Donor
Posts: 994
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci » Mon Mar 11, 2019 3:14 pm

So I downloaded latest daily and plugin to be sure and here's my result out of the box no settings changed, just opening and rendering the scene:
cacheout.jpg
and here's how things look when I make the meshlight more powerful - you can see how meshlight samples are separated from environment light samples in cache debug:
cacheout_stronglight.jpg

Fox
Posts: 229
Joined: Sat Mar 31, 2018 11:17 am

Re: PhotonGI cache

Post by Fox » Mon Mar 11, 2019 3:53 pm

Can it be related to

Code: Select all

bool TracePhotonsThread::TracePhotonPath(RandomGenerator &rndGen,
		const vector<float> &samples,
		vector<RadiancePhotonEntry> &newIndirectPhotons,
		vector<Photon> &newCausticPhotons) {
	// Hard coded RR parameters

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

Re: PhotonGI cache

Post by B.Y.O.B. » Mon Mar 11, 2019 3:57 pm

Maybe too many photons are fired from the mesh emitter and not enough from the sky?
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by lacilaci » Mon Mar 11, 2019 4:01 pm

B.Y.O.B. wrote:
Mon Mar 11, 2019 3:57 pm
Maybe too many photons are fired from the mesh emitter and not enough from the sky?
An interesting thing is, if I raise the amount of photons and cache size (to a very lare number) I can cover up back the cache entries from meshlight with entries from skylight, HOWEVER the moment I raise power of meshlight once more, it starts again replacing entries from enviro light.... And performance suffers greatly!.

In my office scene there are plenty small lightsources, monitor displays and lightbulbs from pendands and they all eat away from cache/ replace stronger cache entries from sun and sky. This results in a very crappy looking cache and performance is just as bad as not using cache at all.

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

Re: PhotonGI cache

Post by marcatore » Mon Mar 11, 2019 4:22 pm

light strategy has an impact on how PGI distribute photons?

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

Re: PhotonGI cache

Post by Dade » Mon Mar 11, 2019 5:27 pm

marcatore wrote:
Mon Mar 11, 2019 4:22 pm
light strategy has an impact on how PGI distribute photons?
Yes, it does.
Support LuxCoreRender project with salts and bounties

Fox
Posts: 229
Joined: Sat Mar 31, 2018 11:17 am

Re: PhotonGI cache

Post by Fox » Tue Mar 12, 2019 2:25 am

Fox wrote:
Mon Mar 11, 2019 3:53 pm
Can it be related to

Code: Select all

bool TracePhotonsThread::TracePhotonPath(RandomGenerator &rndGen,
		const vector<float> &samples,
		vector<RadiancePhotonEntry> &newIndirectPhotons,
		vector<Photon> &newCausticPhotons) {
	// Hard coded RR parameters
I replaced in tracevisibilitythread.cpp and in tracephotonsthread.cpp, the default RR parameters with 2048 and cap 1.
In scene file also RR 2048 cap 1 and photon and path depth 2048. Can't see any point in that, no visible difference in final render, but 19 hours cache compute time. Although caustic cache seems to be little bigger than indirect.
indirect photon stored: 368554383, memory usage 1063 Kbytes
caustic photon stored: 473434, memory usage 44095 Kbytes

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

Re: PhotonGI cache

Post by Dade » Tue Mar 12, 2019 9:51 am

Fox wrote:
Tue Mar 12, 2019 2:25 am
I replaced in tracevisibilitythread.cpp and in tracephotonsthread.cpp, the default RR parameters with 2048 and cap 1.
It is equivalent to disable RR.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by Dade » Tue Mar 12, 2019 10:55 am

lacilaci wrote:
Mon Mar 11, 2019 4:01 pm
An interesting thing is, if I raise the amount of photons and cache size (to a very lare number) I can cover up back the cache entries from meshlight with entries from skylight, HOWEVER the moment I raise power of meshlight once more, it starts again replacing entries from enviro light.... And performance suffers greatly!.

In my office scene there are plenty small lightsources, monitor displays and lightbulbs from pendands and they all eat away from cache/ replace stronger cache entries from sun and sky. This results in a very crappy looking cache and performance is just as bad as not using cache at all.
It is very strange, it wasn't happening to me because I was using an older version of BlendLuxCore. After updating the plugin, it is happening here too.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by Dade » Tue Mar 12, 2019 11:05 am

I'm pretty sure the problem is triggered by the light source having 480 triangles. This is over the 256 threshold used to disable direct light sampling.

I will check and fix the code to handle this case but using light sources with hundred of triangles is not efficient.
Support LuxCoreRender project with salts and bounties

Post Reply