PhotonGI cache

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

Re: PhotonGI cache

Post by Dade »

happyboy wrote: Tue Aug 13, 2019 1:28 am
Dade wrote: Mon Aug 12, 2019 1:09 pm The sample size is very wrong, I guess I forgot to update the value, it should 4 (unable to check the code at the moment). It is the number of samples required for each path vertex and +3 suggests it uses 4 values at the moment.
Thank you, alpistinho & Dade!
I'll use my own fix for now and wait for Dade back from holiday 8-)
I should have fixed the problem.
Support LuxCoreRender project with salts and bounties
happyboy
Posts: 63
Joined: Sat Jun 22, 2019 5:39 am

Re: PhotonGI cache

Post by happyboy »

Dade wrote: Sun Aug 18, 2019 3:06 pm I should have fixed the problem.
It still crashes...you increased sampleStepSize, so sampleSize and sampleOffset increased in the same way?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

happyboy wrote: Wed Aug 21, 2019 12:06 pm It still crashes...you increased sampleStepSize, so sampleSize and sampleOffset increased in the same way?
Yes, look at the code:

Code: Select all

	// Request the samples
	const u_int sampleBootSize = 5;
	const u_int sampleStepSize = 4;
	const u_int sampleSize = 
		sampleBootSize + // To generate eye ray
		params.maxPathDepth * sampleStepSize; // For each path vertex
[...]
			const u_int sampleOffset = sampleBootSize + depthInfo.depth * sampleStepSize;
I have also run the code with some additional assert() to check the requested sample indices.

So if it still crash it should be something different, just re-run the new code under a debugger and post where the crash is.
Support LuxCoreRender project with salts and bounties
happyboy
Posts: 63
Joined: Sat Jun 22, 2019 5:39 am

Re: PhotonGI cache

Post by happyboy »

Dade wrote: Wed Aug 21, 2019 1:41 pm So if it still crash it should be something different, just re-run the new code under a debugger and post where the crash is.
My bad! for some reason the old version sits in the PATH before the new version so I was testing the old version ...

Now it doesn't crash anymore. Tried to render 10+ times. Thanks!!!

And looking closer at the code, I understood your fix: since depth starts from 0 instead of 1, sampleSize is always at least 4 larger than sampleOffset, so it will not crash at that point.
provisory
Posts: 235
Joined: Wed Aug 01, 2018 4:26 pm

Re: PhotonGI cache

Post by provisory »

Is it a known issue or maybe intentional that PGI doesn't work on Mix Material, even if the mixed materials would work in themselves?
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: PhotonGI cache

Post by epilectrolytics »

provisory wrote: Tue Sep 10, 2019 9:21 amPGI doesn't work on Mix Material
Noticed that too.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

provisory wrote: Tue Sep 10, 2019 9:21 am Is it a known issue or maybe intentional that PGI doesn't work on Mix Material, even if the mixed materials would work in themselves?
It should work but depends a lot on what you are mixing: there are parameters like glossiness or if a material is only DIFFUSE/GLOSSY/SPECULAR, etc. that may disable PhotonGI. For instance, if you mix "matte" with "mirror, PGI will disable indirect cache on that material because it can be "SPECULAR".

If you post a test scene, I can tell you what is going on.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

I have this idea that might be a bit stupid but maybe not:

Would it be possible to control after how many bounces is photongi used? Maybe this would help with some reflection artifacting or leaks?

So maybe have 1 or 2 bounces brute force and afterwards sample from cache(a control exposed to the user).

The reason is that sometimes luxcore performs well in interior even without photongi but some areas are a bit "too deep" in terms of gi so they could benefit from photongi. However enabling cache might bring some artifacting even to areas which were ok and fast before. So I have to pick between artifacts and speed...

In my head I think this could help protect areas exposed to few bounces but still give speedup for hard to reach areas.
provisory
Posts: 235
Joined: Wed Aug 01, 2018 4:26 pm

Re: PhotonGI cache

Post by provisory »

Dade wrote: Wed Sep 11, 2019 2:03 pm If you post a test scene, I can tell you what is going on.
Here you go and Thanks!

(I know, that there is no point in mixing Glossy with Matte. It came up in this topic: viewtopic.php?f=4&t=1372)
Attachments
PGIvsMixed-Mix.jpg
PGIvsMixed-Matte.jpg
PGIvsMixed-Glossy.jpg
PGIvsMixed.blend
(535.57 KiB) Downloaded 162 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

provisory wrote: Wed Sep 11, 2019 4:56 pm
Dade wrote: Wed Sep 11, 2019 2:03 pm If you post a test scene, I can tell you what is going on.
Here you go and Thanks!

(I know, that there is no point in mixing Glossy with Matte. It came up in this topic: viewtopic.php?f=4&t=1372)
Ok, the problem was that mix (and glossycoatting) report their glossiness as Min() of the referenced materials and any not GLOSSY material report a glossiness of 0.0: so the result when mixing not glossy materials was always 0.0 (and PGI was disabled).

I should have fixed the problem: now only the glossiness of GLOSSY materials is taken in account and this should fix the problem for mix (and glossycoatting).
Support LuxCoreRender project with salts and bounties
Post Reply