PhotonGI cache

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

Re: PhotonGI cache

Post by epilectrolytics » Fri Apr 12, 2019 1:27 pm

Dade wrote:
Fri Apr 12, 2019 10:07 am
Why are you setting the values by hand ?
Because of B.Y.O.B.'s suggestion:
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.
For example by using a smaller entry radius and/or raising the brute force radius scale (aka usage threshold scale).
Dade wrote:
Fri Apr 12, 2019 10:07 am
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).
But I used the automatic options as provided in the Blender build from April 11th, they are stored in the bunkercache2.blend file I posted above:
Screenshot (44).jpg
There is no option to set indirect cache size any more instead there is a quality threshold I set to "final" (5%).
I used 100 million photon count and automatic lookup radius, brute force radius does not matter for the debug view.
This is the scene with your parameters:
im1.jpg
and this with automatic conditions:
im2.jpg
It is a lot better.
This does absolutly not look like my result, see also the gif sequence above.
My result looks like your automatic one, maybe you are using LuxCoreUI ?

Let's recap:
KintuX (here), Luxart (here) and I have tried PGI animation and experienced flickering.
All of us have intuitively chosen to animate the same frame in order to exclude other sources for flickering and instead concentrate on what the cache causes.
We assume if (temporal) cache variance could be diminished, using PGI for object (not only camera) animation would become possible.
The question is what parameters need to be tuned to get less cache variance?

My take is that there is a problem with photon distribution of infinite (sky) lights causing high cache variance prohibiting animation without flicker, even with tuned parameters.
This affects mainly scenes rendered with Lux sun+sky system, which is kind of a standard case.
In order to test this I use my bunker scene with the settings unchanged as in screenshot above and disable the sky background, so there is only sun light left:
sun.gif
This looks relatively smooth and I think it could be possible with better parameters to minimize the variance to the point animation is free of flickering.

Now I do the opposite, disable the sun and activate sky only instead (also 10x higher gain in tonemapper because sky alone is too dark):
sky.gif
Now this shows a very inhomogeneous photon distribution with a high variance from frame to frame.
My conclusion is that sampling of infinite light photons is insufficient and needs to be improved.
- In combination with sunlight bad skylight sampling is the reason for the flickering we have experienced in our experiments
- The visible splotches show up directly in the caustic cache and disturb caustic renders with skylight
- They show up also in glossy reflections and produce ghost reflections on shiny floors in interior renders with sun+sky.
- PGI with directional light sources shows better results with smoother sampling and might be ready for animation with more fine tuning

Some parameters that might help reducing cache variance like cache filtering value and indirect lookup max count are not exposed in Blender.
Maybe they could get different defaults for animations.
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: 3144
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade » Fri Apr 12, 2019 1:55 pm

epilectrolytics wrote:
Fri Apr 12, 2019 1:27 pm
There is no option to set indirect cache size any more instead there is a quality threshold I set to "final" (5%).
It may be a left over/bug for a scene edited with an older BlendLuxCore but your scene has indirect cache size set and a very small photon count:

Code: Select all

path.photongi.indirect.maxsize = 3000000
path.photongi.photon.maxcount = 100000
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Fri Apr 12, 2019 2:05 pm

Yes it is an old scene made with an earlier PGI version when there was no automatic setting and it was likely used to export binaries too.
But when I reopen it in current Blender I expect the new defaults to be exported correctly :?
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

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

Re: PhotonGI cache

Post by B.Y.O.B. » Fri Apr 12, 2019 2:41 pm

When I open your .blend and start a render with property debug print, I get these properties:

Code: Select all

path.photongi.photon.maxcount = 100000000
path.photongi.indirect.maxsize = 0
You could try to do the same and see what is printed in the console.
Property debug printing can be enabled by searching for the "debug" operator in Blender, then enable the "Print Properties" option:
Attachments
2019-04-12_16-39-49.png
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Fri Apr 12, 2019 3:15 pm

B.Y.O.B. wrote:
Fri Apr 12, 2019 2:41 pm
Property debug printing can be enabled by searching for the "debug" operator in Blender, then enable the "Print Properties" option:
Sorry for being stupid, but where is the search field in Blender ?? :oops:
There is a python console, but without search field. :?

Instead I conventionally export to .cfg and get this (excerpt):

Code: Select all

path.photongi.photon.maxcount = 100000000
path.photongi.indirect.lookup.normalangle = 30.000000834826057
path.photongi.caustic.lookup.maxcount = 128
path.photongi.indirect.glossinessusagethreshold = 0.20000000298023224
path.photongi.indirect.haltthreshold = 0.050000000000000003
path.photongi.indirect.lookup.radius = 0
Looks to be same as B.Y.O.B.'s result, maybe Dade is using an older LuxBlend version :?:
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, 2 x RTX 2070

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

Re: PhotonGI cache

Post by B.Y.O.B. » Fri Apr 12, 2019 3:32 pm

epilectrolytics wrote:
Fri Apr 12, 2019 3:15 pm
Sorry for being stupid, but where is the search field in Blender ??
Press space in a 3D view.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by Dade » Fri Apr 12, 2019 3:58 pm

epilectrolytics wrote:
Fri Apr 12, 2019 3:15 pm
Looks to be same as B.Y.O.B.'s result, maybe Dade is using an older LuxBlend version :?:
Yes, it is this for sure.
Support LuxCoreRender project with salts and bounties

Luxart
Posts: 49
Joined: Tue Feb 13, 2018 10:14 am

Re: PhotonGI cache

Post by Luxart » Sat Apr 13, 2019 7:50 am

epilectrolytics wrote:
Fri Apr 12, 2019 1:27 pm

Let's recap:
KintuX (here), Luxart (here) and I have tried PGI animation and experienced flickering.
Did few more testing and my observed points:

1, Increasing Brute force radius scale: parameter reduces 75 % of flickering.

2, Manually setting both the Lookup radius and Brute force radius scale parameters reduces 95% of flickering (manageable level)

and my suggestions:

3, The calculated automatic lookup radius should be displayed (like clamp value suggestion), so that user can easily decide the best Brute force radius scale parameter.

4, Currently without knowing the automatic lookup radius value, it's hard to judge the Brute force radius scale parameter as sometimes it may lead to artifact free render but it may not use Photon GI cache at all (pure path tracing).

kintuX
Posts: 471
Joined: Wed Jan 10, 2018 2:37 am

Re: PhotonGI cache

Post by kintuX » Sat Apr 13, 2019 9:02 am

Another, simple interior animation:
Scene Source: https://www.fstormrender.ru/forum/forum ... -vs-octane

Tools used: Blender 2.79b with BlendLuxCore 2.2 alpha (daily 2019-04-12)

Translated Scene used: Interior_test_LC2.7z (@ MEGA)


Stats (mostly default)

LuxCore PT, Sobol @ 0.80, PGI on, OIDN on...
Resolution: SD (720p), Output format .jpg @ 90%
Halt: 64 samples
GPU: GTX 1060 6GB ~ 40sec/frame (final w/ post)

Preview:
Image

Final Video @ Streamable "Interior Test LC2"


Notes:
There's something about Sun & Sky model that keeps me restless:

1. Sun color can't be easily controlled, only uses turbulence value + angle to define it :shock: should also be overwritten by Color or Temp.
;) Bypass > Mix in Gain Color

2. Sky... hmmm, how can i explain it simply? It feels as if photons coming from outside bounce around randomly - they don't seem to be "guided" inside in a "beam" but are scattered (in small amount), which creates new set of problems (IDK, if that makes sense). I'm thinking "Portals" would still need to be present (at least as guides) to help control/define the scattering angle (I'm thinking "Portal" shouldn't scatter light @ 90°but is more concentrated like light coming through a 'pinhole' in "Camera Obscura" where scattering depends on a window size or opening in a wall.
Last edited by kintuX on Sat Apr 13, 2019 9:14 am, edited 3 times in total.

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

Re: PhotonGI cache

Post by B.Y.O.B. » Sat Apr 13, 2019 9:13 am

Luxart wrote:
Sat Apr 13, 2019 7:50 am
3, The calculated automatic lookup radius should be displayed (like clamp value suggestion), so that user can easily decide the best Brute force radius scale parameter.
It is printed in the console output, but yes, it should be shown in the UI.
Support LuxCoreRender project with salts and bounties

Post Reply