Tiled OIDN Denoising

Discussion related to the LuxCore functionality, implementations and API.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Tiled OIDN Denoising

Post by CodeHD »

B.Y.O.B. wrote: Wed Mar 20, 2019 1:59 pm Not related to your problem, but I would try to de-duplicate the code here and here.
Try to do all the stripe processing in one for loop, without the code outside the loop.
You can check if you are doing the first stripe by testing (i == 0).
Good suggestion, but I have actually already done that in the meanwhile ;)

I have also found the error for the problem above. I had written the denoised part including the overlap region back into the pixel array in each iteration. As a result, the next iteration received the already denoised overlap region together with the noisy rest.
I introduced a new overlapBuffer, and now it seems to finally work :D

I currently still have a battery of unused variables that I created when I cleaned up the loop, I will push the new code after taking care of that.

Finally some (low-res) test images.
The attachment RGB_IMAGEPIPELINE_0.png is no longer available
RGB_IMAGEPIPELINE_0.png
RGB_IMAGEPIPELINE_1.png
hotel_1.png
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Tiled OIDN Denoising

Post by B.Y.O.B. »

Nice progress :)
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Tiled OIDN Denoising

Post by lacilaci »

Looking good :shock:
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Tiled OIDN Denoising

Post by Sharlybg »

Really inspiring result :)
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Tiled OIDN Denoising

Post by CodeHD »

All working now :)

https://github.com/CodeFHD/LuxCore/blob ... l_oidn.cpp

https://github.com/CodeFHD/LuxCore/blob ... tel_oidn.h

I included a function to choose between tiled or simple OIDN based on resolution.
As by my explation before, I went for hard-coded 8 stripes, 100 pixel overlap region (2x50), and using the stripe-OIDN starting at 3840x2160 = 8.2944 MPixel. (I don't know how to include this into the settings, so that it could be changed in the cfg file.)

I just tried the hotel scene again at 7680x4320. Each OIDN stripe needed ~6-7 GB of RAM. My system (with 32GB RAM) stayed just withing 16GB total RAM usage that way, with some other applications open.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Tiled OIDN Denoising

Post by B.Y.O.B. »

CodeHD wrote: Wed Mar 20, 2019 9:43 pm (I don't know how to include this into the settings, so that it could be changed in the cfg file.)
You can parse properties here:
https://github.com/LuxCoreRender/LuxCor ... e.cpp#L603
Looking at the other plugins in that big if/else should help you see how it works, if it's not clear I can go into further detail.
Basically you first add the parameters to the plugin's constructor, then parse them from the .cfg file in the method I linked and pass them to the plugin when calling its constructor.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Tiled OIDN Denoising

Post by CodeHD »

B.Y.O.B. wrote: Wed Mar 20, 2019 10:30 pm You can parse properties here:
Looks like a good start, thanks!
Anyways, I probably won't be able to continue until Sunday, so feel free to copy the current, hard-coded version into the daily builds for others to test. If you think it is worth it, anyways ;)
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Tiled OIDN Denoising

Post by kintuX »

CodeHD wrote: Sun Mar 17, 2019 12:30 am
kintuX wrote: Sat Mar 16, 2019 1:11 pm Love glitches, love the work you do... keep fighting ;)

BTW
Up to how many splits this tiling can do?
ie. What happens if number of splits is equal or exceeds number of pixels? Crash, glitch, warning or no work done?
Man, am eager to test it 8-)
Who said I won't keep fighting? ;)
Mmmm... is it possible to give it a punch :mrgreen: can I?
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Tiled OIDN Denoising

Post by CodeHD »

kintuX wrote: Wed Apr 03, 2019 11:43 am Mmmm... is it possible to give it a punch :mrgreen: can I?
Depending on how hard you punch... :D

No seriously though, I just came here to write an update. I am still quite busy at the moment, and will be on travel most of the time until (and including) easter (and just returned from one)...

Depending on what you mean by giving it a punch: go ahead and test it, develop it further. As I said above, the code as linked should work, you need (only :roll:) to compile luxcore yourself with the two files changed. If you want to pounch me into continuing, I would only start again after easter, sorry...
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Tiled OIDN Denoising

Post by kintuX »

CodeHD wrote: Wed Apr 03, 2019 6:57 pm
kintuX wrote: Wed Apr 03, 2019 11:43 am Mmmm... is it possible to give it a punch :mrgreen: can I?
Depending on how hard you punch... :D

No seriously though, I just came here to write an update. I am still quite busy at the moment, and will be on travel most of the time until (and including) easter (and just returned from one)...

Depending on what you mean by giving it a punch: go ahead and test it, develop it further. As I said above, the code as linked should work, you need (only :roll:) to compile luxcore yourself with the two files changed. If you want to pounch me into continuing, I would only start again after easter, sorry...
OK. No problem, gave it a first punch - compiled it :D (Windows x64 LuxCore tiledOIDN binaries here).
First, "blind" test done :? (I think - everyone is welcome to confirm, if it's working or not)

But I need to get and devote more-more time, diving deeper to get to grips with standalone, OCL, Blender, python and all... 2nd step is how to make an openCL build with it? slowly on to reading, getting characteristics, properties and associate it with Blender... ahhh... well - i'm just so slow :oops:

Anyways, Thank you for everything.
Post Reply