PhotonGI cache

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

Re: PhotonGI cache

Post by Dade » Sun Aug 18, 2019 3:06 pm

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: 51
Joined: Sat Jun 22, 2019 5:39 am

Re: PhotonGI cache

Post by happyboy » Wed Aug 21, 2019 12:06 pm

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

Re: PhotonGI cache

Post by Dade » Wed Aug 21, 2019 1:41 pm

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: 51
Joined: Sat Jun 22, 2019 5:39 am

Re: PhotonGI cache

Post by happyboy » Thu Aug 22, 2019 6:11 am

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: 199
Joined: Wed Aug 01, 2018 4:26 pm

Re: PhotonGI cache

Post by provisory » 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?

User avatar
epilectrolytics
Donor
Donor
Posts: 519
Joined: Thu Oct 04, 2018 6:06 am

Re: PhotonGI cache

Post by epilectrolytics » Tue Sep 10, 2019 12:02 pm

provisory wrote:
Tue Sep 10, 2019 9:21 am
PGI doesn't work on Mix Material
Noticed that too.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

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

Re: PhotonGI cache

Post by Dade » Wed Sep 11, 2019 2:03 pm

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: 1519
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci » Wed Sep 11, 2019 4:55 pm

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: 199
Joined: Wed Aug 01, 2018 4:26 pm

Re: PhotonGI cache

Post by provisory » 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)
Attachments
PGIvsMixed-Mix.jpg
PGIvsMixed-Matte.jpg
PGIvsMixed-Glossy.jpg
PGIvsMixed.blend
(535.57 KiB) Downloaded 2 times

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

Re: PhotonGI cache

Post by Dade » Thu Sep 12, 2019 7:42 am

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