PhotonGI cache

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

Re: PhotonGI cache

Post by lacilaci »

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: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: PhotonGI cache

Post by Fox »

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: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: PhotonGI cache

Post by B.Y.O.B. »

Maybe too many photons are fired from the mesh emitter and not enough from the sky?
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

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
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: PhotonGI cache

Post by marcatore »

light strategy has an impact on how PGI distribute photons?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

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: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: PhotonGI cache

Post by Fox »

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: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

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: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

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: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

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