Page 8 of 109

Re: PhotonGI cache

Posted: Mon Jan 21, 2019 1:08 pm
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.

Re: PhotonGI cache

Posted: Thu Jan 24, 2019 10:55 pm
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

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 6:09 am
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 :)

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 7:50 am
by marcatore
Can't wait to try it :)

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 7:56 am
by FarbigeWelt
Looking forward to trying it!

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 10:18 am
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.

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 10:31 am
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?

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 10:34 am
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.

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 10:51 am
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).

Re: PhotonGI cache

Posted: Fri Jan 25, 2019 11:13 am
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?