PhotonGI cache

Discussion related to the LuxCore functionality, implementations and API.
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: PhotonGI cache

Post by marcatore »

B.Y.O.B. wrote: Mon Jan 21, 2019 10:22 am I think the need for this depends on how much trial and error is involved to find the right settings for the PhotonGI cache.
If you need a lot of trial and error, starting 10 renders or so until you found good setttings for photon count, radius etc., then it would be very good to have this pre-visualization.
On the other hand, if we manage to make this setting-finding process automatic or super fool proof, I think it would be ok to skip the pre-viz step.
completely agree with this.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

A fast update, tomorrow I will write an extensive explanation: I have the first working version with Metropolis photon tracing. This is the number of caustic photons created with a Random sampler while rendering Psor's cube:

Code: Select all

[LuxCore][0.780] Photon GI total caustic photon stored: 7600 (1000000 traced)
and this with Metropolis:

Code: Select all

[LuxCore][1.243] Photon GI total caustic photon stored: 172059 (1000000 traced)
In both cases I'm tracing 1000000 photons paths. So Metropolis is 172059 / 7600 = ~22.6 times better than Random sampler. In other word, Metropolis is ~22.6 times faster to fill the caustic photon cache ... quit good :D
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 »

Dade wrote: Thu Jan 24, 2019 10:55 pm A fast update, tomorrow I will write an extensive explanation: I have the first working version with Metropolis photon tracing. This is the number of caustic photons created with a Random sampler while rendering Psor's cube:

Code: Select all

[LuxCore][0.780] Photon GI total caustic photon stored: 7600 (1000000 traced)
and this with Metropolis:

Code: Select all

[LuxCore][1.243] Photon GI total caustic photon stored: 172059 (1000000 traced)
In both cases I'm tracing 1000000 photons paths. So Metropolis is 172059 / 7600 = ~22.6 times better than Random sampler. In other word, Metropolis is ~22.6 times faster to fill the caustic photon cache ... quit good :D
can't wait to see some pictures :)
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: PhotonGI cache

Post by marcatore »

Can't wait to try it :)
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: PhotonGI cache

Post by FarbigeWelt »

Looking forward to trying it!
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

This is a caustic cache built with Random sampler:
random.jpg

And this with Metropolis sampler:

mt.jpg

You can get a pretty sharp caustic cache with only 2-3 secs of preprocessing (compared to the 25-30secs of the first post):

fast.jpg

The current Metropolis target function only account for filling the cache, the next step is to account for visibility too: photon will be shot where they are useful to fill the cache and can be seen.
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 »

one thing that comes to mind... You mentioned to me in past that metropolis on gpu is "problematic" so could this work on gpu? Or can we build cache on cpu and then use the result with gpu brute force?
Last edited by lacilaci on Fri Jan 25, 2019 10:48 am, edited 1 time in total.
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: PhotonGI cache

Post by Sharlybg »

That is a pretty insane improvement from half a minute to 2 or 3 secs.
The current Metropolis target function only account for filling the cache, the next step is to account for visibility too: photon will be shot where they are useful to fill the cache and can be seen.
efficient use of fired photton will mean far less settings and trial/error and also splotches.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
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: Fri Jan 25, 2019 10:31 am Or can we build cache on cpu and then use the result with cpu brute force?
Yes, it is also as DLSC already works and it is what I always do: all the pre-processing is done on the CPU and the result is used both for CPU and GPU rendering. Some stuff (like Metropolis doesn't really work well on GPUs) and it makes the development "cost" reasonable: I have to re-write the code only for the GPU rendering (the pre-procesing data are just transferred).
Support LuxCoreRender project with salts and bounties
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: PhotonGI cache

Post by FarbigeWelt »

Dade wrote: Fri Jan 25, 2019 10:51 am
Yes, it is also as DLSC already works and it is what I always do: all the pre-processing is done on the CPU and the result is used both for CPU and GPU rendering. Some stuff (like Metropolis doesn't really work well on GPUs) and it makes the development "cost" reasonable: I have to re-write the code only for the GPU rendering (the pre-procesing data are just transferred).
In my opinion this is a very smart approach!
And your test results show me and underline a paper I gave read about Metropolis method that the potential of it were immense if only its set up were not so scene specific to achieve a fast noise reduced result.
Is it be posible to use your cache filling Metropolis algorithm to estimate appropriate settings for the shader?
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
Post Reply