PhotonGI cache

Discussion related to the Engine functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 2593
Joined: Mon Dec 04, 2017 8:36 pm

Re: PhotonGI cache

Post by Dade » Mon Jun 17, 2019 8:21 pm

lacilaci wrote:
Mon Jun 17, 2019 7:35 pm
Btw. I do hope by "closing pending stuff" you also mean fix for vis. cache bug and also make that env cache work on gpu :)
"vis. cache" = "env cache" ?

(But yes, that is the idea)
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Mon Jun 17, 2019 8:23 pm

provisory wrote:
Sat Jun 01, 2019 7:30 pm
I have two ideas how to make PGI cache (more) unbiased. ...

1. Cyclically re-generating the cache
Dade wrote:
Mon Jun 17, 2019 2:56 pm
I added the support for periodic update of the PGI caustic cache to PATHCPU
:idea:

Ha!
Team Genius at work!

Great solution, way better than caustic merge radius.
Already tested and it works well on my causticcube test scene, but when changing from sunsky to distant I got crazy lighting,
will report in user support forum.

And stupid me thought caustic cache was a dead end,
but never underestimate the Dade!

:D
Dade wrote:
Mon Jun 17, 2019 6:05 pm
Sharlybg wrote:
Mon Jun 17, 2019 5:12 pm
Huuuh do you mean it can be the same for Indirect cache ? so it turn as an online cache ?
The same process would be trivial to do for indirect cache (i.e. it would require to change only one line of code) but it would be practically useless: indirect cache already works well as it is.
There is a problem with erratic photon distribution from infinite light leading to ghost reflections in glossy surfaces, that could be helped with cyclic cache.
Also we experienced flickering when animating objects and writing a new cache for each frame, smoothed cyclic indirect cache might reduce flicker and make possible rendering object animation with PGI :!:

If it is only change of one line of code we should test it.

Cyclic cache prevents persistent cache, that has to be exposed properly in Blender.
It could get complicated like this:
Rendering an animation with persistent indirect cache plus a cyclic caustic cache.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, RTX 2070, GTX 1060

User avatar
Dade
Developer
Developer
Posts: 2593
Joined: Mon Dec 04, 2017 8:36 pm

Re: PhotonGI cache

Post by Dade » Mon Jun 17, 2019 10:34 pm

epilectrolytics wrote:
Mon Jun 17, 2019 8:23 pm
Cyclic cache prevents persistent cache, that has to be exposed properly in Blender.
Persistent (indirect) cache should work, persistent (caustic) cache should work too but it quite pointless as the saved cache will be used only for the very first cycle ... don't talk about "Cycles" ... it confuse me :mrgreen:
epilectrolytics wrote:
Mon Jun 17, 2019 8:23 pm
It could get complicated like this:
Rendering an animation with persistent indirect cache plus a cyclic caustic cache.
This should already work (see above).
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Tue Jun 18, 2019 8:32 am

Thanks B.Y.O.B. for quick Blender integration!

Only it does not really work yet:
Cache update does not seem to happen as also indicated by console view which shows no entries during render.

When exporting a binary and rendering with LuxCoreUI there is the code line (path.photongi.caustic.updatespp) and the render updates properly with the corresponding console notifications:
Screenshot.jpg
Also the updating happens one sample later as specified:
If I want cache updates at sample 8,16,24,32... I have to choose 7 as parameter.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, RTX 2070, GTX 1060

User avatar
Dade
Developer
Developer
Posts: 2593
Joined: Mon Dec 04, 2017 8:36 pm

Re: PhotonGI cache

Post by Dade » Tue Jun 18, 2019 8:49 am

epilectrolytics wrote:
Tue Jun 18, 2019 8:32 am
Also the updating happens one sample later as specified:
If I want cache updates at sample 8,16,24,32... I have to choose 7 as parameter.
This is normal, the update is done at least after X samples, not exactly at X samples (threads continue to asynchronous render while the need of an update is recognized, they a will always render a bit more before they can stop for the update, this will be even more noticeable with GPUs).
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by B.Y.O.B. » Tue Jun 18, 2019 9:29 am

epilectrolytics wrote:
Tue Jun 18, 2019 8:32 am
Only it does not really work yet:
Cache update does not seem to happen as also indicated by console view which shows no entries during render.
Are you sure? In my tests it worked in Blender, although the console messages indeed do not appear.
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Developer
Posts: 2593
Joined: Mon Dec 04, 2017 8:36 pm

Re: PhotonGI cache

Post by Dade » Tue Jun 18, 2019 10:26 am

Added the support to OpenCL for PhotonGI caustic cache update.
Support LuxCoreRender project with salts and bounties

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

Re: PhotonGI cache

Post by epilectrolytics » Tue Jun 18, 2019 10:53 am

B.Y.O.B. wrote:
Tue Jun 18, 2019 9:29 am
Are you sure? In my tests it worked in Blender, although the console messages indeed do not appear.
New test scene works, the reason was this:
Dade wrote:
Tue Jun 18, 2019 8:49 am
epilectrolytics wrote:
Tue Jun 18, 2019 8:32 am
Also the updating happens one sample later as specified:
If I want cache updates at sample 8,16,24,32... I have to choose 7 as parameter.
This is normal, the update is done at least after X samples, not exactly at X samples (threads continue to asynchronous render while the need of an update is recognized, they a will always render a bit more before they can stop for the update, this will be even more noticeable with GPUs).
My first tests in LuxCoreUI showed when I enter periodic sample step of 7, the caustic pattern in the render view will change after 8,16,24... samples (corresponding with console print).
In Blender that did not happen. Obviously it changed at other sample counts when I was not looking :oops: :lol:

Edit: Tested with this scene: Takes 3.5min = 40 samples for first cache update!

All is well, sorry for confusion, good job guys!
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, RTX 2070, GTX 1060

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

Re: PhotonGI cache

Post by epilectrolytics » Tue Jun 18, 2019 2:36 pm

Dade wrote:
Tue Jun 18, 2019 10:26 am
Added the support to OpenCL for PhotonGI caustic cache update.
Maybe I'm stupid again, but I don't get it to work.
From Blender, where PathCPU + periodic cache works, I get mostly crashes when I try with OpenCL.
When using standalone, again PathCPU updates but PathOCL crashes or renders without updating.

Using build 20190618.1 (commit 526e952), feels like OpenCL support is not included or very buggy on Windows 10.
MBPro 15" 16GB i7-4850HQ GT750M, MacOS 10.13.6 & Win10Pro PC 16GB Ryzen 2700X, RTX 2070, GTX 1060

provisory
Posts: 133
Joined: Wed Aug 01, 2018 4:26 pm

Re: PhotonGI cache

Post by provisory » Tue Jun 18, 2019 5:22 pm

B.Y.O.B. wrote:
Mon Jun 17, 2019 6:36 pm
By the way, I get a crash when I cancel the render while the periodic update is running.
OS is Linux.
It crashes for me too, when I stop the render during the cache update. (Win 10, CPU, not OpenCL)

Post Reply