PhotonGI cache

Discussion related to the Engine functionality, implementations and API.
Luxart
Posts: 49
Joined: Tue Feb 13, 2018 10:14 am

Re: PhotonGI cache

Post by Luxart » Thu Apr 11, 2019 10:11 am

Dade wrote:
Thu Apr 11, 2019 9:21 am
Luxart wrote:
Thu Apr 11, 2019 6:45 am
In general animation (edit all objects) flickering problem occurs.
Have you done some test ? It would be interesting to see the results. I mean, it would be an expected problem but it is hard to see any difference between "brute force path tracing" alone and brute "force path tracing+PGI" renderings so it is possible that any flicker could be solved by just adjusting some parameter.
Sorry I deleted the (1 sec) test file by mistake. But here is the quick overview of problem in the attached images.

There is a varying light intensity under the sofa and book shelf shadows (comparing images side by side reveals the problem).

the variation of light intensity is small but noticeable.
Attachments
PGIC.png
PGIC1.png
PGIC2.png
PGIC3.png

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2997
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: PhotonGI cache

Post by B.Y.O.B. » Thu Apr 11, 2019 10:26 am

epilectrolytics wrote:
Thu Apr 11, 2019 7:30 am
Building of the cache introduces bias which partly depends on the photon distribution.
A moving object affects the photon distribution which will then in each frame lead to a different bias on the not moving parts showing as flickering.
It might be possible to reduce the bias to the point where you don't notice any flickering.
For example by using a smaller entry radius and/or raising the brute force radius scale (aka usage threshold scale).
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by Dade » Thu Apr 11, 2019 10:57 am

B.Y.O.B. wrote:
Thu Apr 11, 2019 10:26 am
raising the brute force radius scale (aka usage threshold scale).
This :idea:
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Thu Apr 11, 2019 11:18 am

B.Y.O.B. wrote:
Thu Apr 11, 2019 10:26 am
It might be possible to reduce the bias to the point where you don't notice any flickering.
Theoretically yes.
I guess scenes with a single light source could be fine tuned to unnoticeable cache variance.

But there is a problem with the photon distribution especially when there is a infinite light in the mix like with sun+sky.
While the sun photons are evenly distributed, the sky photons are not but appear as blueish splotches here and there.
This is what makes caustic cache unusable in exterior condition and also causes the huge variance in bias of PGI in sunlit scenes.
Also it causes ghost reflections on glossy materials.

I made an animation of my bunker scene once that showed flickering but apparently deleted it, am currently rerendering.
Probably I should do a debug view animation too, will report back later.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

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

Re: PhotonGI cache

Post by epilectrolytics » Thu Apr 11, 2019 12:51 pm

Ok, so here's the bunker animation with flicker :D
bunker.mp4.zip
(1.18 MiB) Downloaded 30 times
and here a sequence of debug renders without camera move:
bunker.gif
It seems that the photon cast uses a different seed every time even if there is no change in the scene.
Maybe a fixed seed could calm down things?
Also blueish areas can be seen dancing around wildly, indicating sky photons are less evenly distributed than sun photons.
This was rendered with log power setting.
It is possible to use importance values to shift sampling priority towards sky photons but then the render is badly affected especially with glossy materials.
I think we need a better balance of sun and sky photons, maybe with independent importance sampling for the photon cast.
I tried high values for photon count and brute force radius but still the cache variance is very high.
Here' s the scene without materials:
bunkercache2.blend.zip
(378.17 KiB) Downloaded 30 times
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

User avatar
Sharlybg
Donor
Donor
Posts: 1522
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: PhotonGI cache

Post by Sharlybg » Thu Apr 11, 2019 1:55 pm

Most of the time in architecture light and camera are animated (object are also animated sometimes like windows door again to let light pass through). Just wonder if buiding cache for each frame will also create flickering ? if not (no flickering) then making cache build faster can help.
I was discussing with a friend of my using Vray with 3Dsmax and it told me that in Vray Next Cache is build on the GPU ( he now can see gpu load on GPU-Z while caching as he said).

Is it true ? don't know.

Can it help ? accelerated process are always welcome.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

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

Re: PhotonGI cache

Post by epilectrolytics » Thu Apr 11, 2019 2:27 pm

Sharlybg wrote:
Thu Apr 11, 2019 1:55 pm
Just wonder if buiding cache for each frame will also create flickering ?
That's the case now, because of different photon distribution each frame. So I'm wondering if that can be fixed somehow.
I have not yet experimented with light groups in Lux but it should be possible do build a cache for each light group and then mix them before or while rendering.
Object animation is difficult of course, but a small object moving in a big space, only affecting the illumination of a small part of the space, could be doable.
We already exclude corners from cache lookup and switch to brute force there.
If a character was walking through a hall, it should be possible to exclude, say, double object size around the character from cache lookup and use path instead. Probably that won't work well with directional light where the character casts a shadow across the scene but the more diffuse the light the easier to blend it would be.
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: 3243
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade » Thu Apr 11, 2019 4:06 pm

epilectrolytics wrote:
Thu Apr 11, 2019 12:51 pm
It seems that the photon cast uses a different seed every time even if there is no change in the scene.
Maybe a fixed seed could calm down things?
It is not not a seed related problem, it is the parallelism to produce a not deterministic result: the threads will race for work to do and external factors (like different OS scheduling and load) will lead to different results every time you run the same code.
However, it is not particularly useful to not have flickering while rendering the same frame if you you still have flickering while rendering different frames.

I mean, first we have to look into the problem of fixing different frames than we can think to fix the same frame (if still needed). It is a problem a lot easier to solve.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Thu Apr 11, 2019 5:54 pm

Dade wrote:
Thu Apr 11, 2019 4:06 pm
It is not not a seed related problem
Ok thanks for explanation!
So when the photon pattern is not reproducible then of course it won't be also in different frames.
The remaining question is why the variance is so high even under identical condition.
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: 3243
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade » Fri Apr 12, 2019 10:07 am

epilectrolytics wrote:
Thu Apr 11, 2019 12:51 pm
I tried high values for photon count and brute force radius but still the cache variance is very high.
Why are you setting the values by hand ? Just use automatic stop condition, set the indirect cache size to 0 and leave the default max. photon count (it should be something like 20,000,000).

This is the scene with your parameters:

im1.jpg

and this with automatic conditions:

im2.jpg

It is a lot better.
Support LuxCoreRender project with salts and bounties

Post Reply