PhotonGI cache

Discussion related to the Engine functionality, implementations and API.
User avatar
epilectrolytics
Donor
Donor
Posts: 570
Joined: Thu Oct 04, 2018 6:06 am

Re: PhotonGI cache

Post by epilectrolytics » Mon Feb 11, 2019 9:28 am

Sharlybg wrote:
Mon Feb 11, 2019 9:02 am
What is that ? cache isn't working on glossy shader ?

strange. How Dade manage to get boost on the Bench scene ?
lacilaci wrote:
Mon Feb 11, 2019 9:05 am
Dade I can send you the scene in either .blend or exported from blender for luxcore. If you want to take a look
I think we need a test scene like lacilaci's office (though that is probably too big) with a shiny floor, white walls with very rough reflection, a diffuse ceiling and some items like chairs or something.
That may cover the standard for interior renders and if the PGI works with that it's time for the alpha release.
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: 3249
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade » Mon Feb 11, 2019 9:33 am

lacilaci wrote:
Mon Feb 11, 2019 9:19 am
I think I found the issue, it seems glossy coating material will not use cache!
And I used it in almost every wood material :D
Yes, at the moment the cache is enabled only for:

Code: Select all

bool PhotonGICache::IsPhotonGIEnabled(const BSDF &bsdf) const {
	const BSDFEvent eventTypes = bsdf.GetEventTypes();
	if (((eventTypes == (GLOSSY | REFLECT)) && (bsdf.GetGlossiness() >= params.indirect.glossinessUsageThreshold)) ||
			(eventTypes == (DIFFUSE | REFLECT)))
		return bsdf.IsPhotonGIEnabled();
	else
		return false;
}
So the material must be "DIFFUSE | REFLECT" or "GLOSSY | REFLECT" with a glossiness >= of the threshold.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by lacilaci » Mon Feb 11, 2019 9:50 am

Dade wrote:
Mon Feb 11, 2019 9:33 am
lacilaci wrote:
Mon Feb 11, 2019 9:19 am
I think I found the issue, it seems glossy coating material will not use cache!
And I used it in almost every wood material :D
Yes, at the moment the cache is enabled only for:

Code: Select all

bool PhotonGICache::IsPhotonGIEnabled(const BSDF &bsdf) const {
	const BSDFEvent eventTypes = bsdf.GetEventTypes();
	if (((eventTypes == (GLOSSY | REFLECT)) && (bsdf.GetGlossiness() >= params.indirect.glossinessUsageThreshold)) ||
			(eventTypes == (DIFFUSE | REFLECT)))
		return bsdf.IsPhotonGIEnabled();
	else
		return false;
}
So the material must be "DIFFUSE | REFLECT" or "GLOSSY | REFLECT" with a glossiness >= of the threshold.
I see, for future though:
Since coating will most likely be always very glossy I hope it will be using threshold from it's base material which will most likely be more rough. Otherwise every material having coating will fall outside threshold of glossiness for cache calculation.

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

Re: PhotonGI cache

Post by lacilaci » Mon Feb 11, 2019 10:15 am

more testing (in multiple scenes) shows that cache somehow has less power, don't know if it's lack of bounces, entries, or where the power is lost.
Difference is pretty big

cache
cache.jpg
nocache
nocache.jpg

User avatar
Dade
Developer
Developer
Posts: 3249
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade » Mon Feb 11, 2019 10:19 am

lacilaci wrote:
Mon Feb 11, 2019 10:15 am
more testing (in multiple scenes) shows that cache somehow has less power, don't know if it's lack of bounces, entries, or where the power is lost.
Difference is pretty big
Can you post a test scene ?
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by lacilaci » Mon Feb 11, 2019 10:25 am

Dade wrote:
Mon Feb 11, 2019 10:19 am
lacilaci wrote:
Mon Feb 11, 2019 10:15 am
more testing (in multiple scenes) shows that cache somehow has less power, don't know if it's lack of bounces, entries, or where the power is lost.
Difference is pretty big
Can you post a test scene ?
here... Different lighting but same problem
Just switch off photongi or switch to opencl and compare results
00_concept_lux.zip
(5.12 MiB) Downloaded 34 times

Racleborg
Posts: 466
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: PhotonGI cache

Post by Racleborg » Mon Feb 11, 2019 10:28 am

lacilaci

render-boards.jpg. How do you get lighting to look as good and natural as that? Any chance of a scene? or just the layout of the lighting? ;)

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

Re: PhotonGI cache

Post by lacilaci » Mon Feb 11, 2019 10:35 am

Racleborg wrote:
Mon Feb 11, 2019 10:28 am
lacilaci

render-boards.jpg. How do you get lighting to look as good and natural as that? Any chance of a scene? or just the layout of the lighting? ;)
It's literally just a default sky (no sun)

Rest is in materials, and even those are very basic. a texture for diffuse, bump and for wood I added shiny coating with the same bump as material (probably wasn't even necessary)

Can't share scene publicly cause it contains bunch of non free content too.

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

Re: PhotonGI cache

Post by epilectrolytics » Mon Feb 11, 2019 11:55 am

marcatore wrote:
Mon Feb 11, 2019 9:07 am
in one of my test scene, caching is slowing the rendering, both "samples/sec" and "sample rate" are lower with caching.

what should I do as settings to have benefit from caching?
I'm experiencing the same and I think it is memory interaction.
The bigger the cache and the lookup radius, the more often the processor will fetch cache data from RAM in order to proceed and this is slowing the rendering down.
What settings to use is dependent on the scene and I have not figured out a rule of thump.
Also PGI is constantly changing in development and old settings become obsolete.

Once it is finished and runs on GPU, the faster VRAM will help with this I hope.

Also the caching is meant to reduce lots of noise so that even rendering at half speed would have a benefit in converging.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

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

Re: PhotonGI cache

Post by lacilaci » Mon Feb 11, 2019 12:08 pm

epilectrolytics wrote:
Mon Feb 11, 2019 11:55 am
marcatore wrote:
Mon Feb 11, 2019 9:07 am
in one of my test scene, caching is slowing the rendering, both "samples/sec" and "sample rate" are lower with caching.

what should I do as settings to have benefit from caching?
I'm experiencing the same and I think it is memory interaction.
The bigger the cache and the lookup radius, the more often the processor will fetch cache data from RAM in order to proceed and this is slowing the rendering down.
What settings to use is dependent on the scene and I have not figured out a rule of thump.
Also PGI is constantly changing in development and old settings become obsolete.

Once it is finished and runs on GPU, the faster VRAM will help with this I hope.

Also the caching is meant to reduce lots of noise so that even rendering at half speed would have a benefit in converging.
yes, smaller cache = faster rendering. Instead of relying on faster vram I'd like to have cache small but as high quality as possible, no random colors and dark spots etc... or maybe a step between cache and rendering to correct some samples.

I don't know how corona does it, but last time I remember rendering lightcache pass didn't look very good, and had some random looking spots... yet I've seen no errors, spots, in final rendering.

In luxcore if there is even a small spot that is very different (in color or power) it can show through in final rendering. Maybe highly different samples from neighbors could be filtered out?

Post Reply