OpenImageDenoise

Discussion related to the LuxCore functionality, implementations and API.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: OpenImageDenoise

Post by lacilaci »

Dade wrote: Sun Feb 03, 2019 5:19 pm
acasta69 wrote: Sun Feb 03, 2019 4:59 pm Intel Oidn.
Anyone else always read "Odin" instead of "Oidn" ? :lol:
Yes, all the time. Sounds much better than OIDN.
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: OpenImageDenoise

Post by Sharlybg »

Anyone else always read "Odin" instead of "Oidn" ? :lol:
Anyway Odin is better to read than OIDN :mrgreen:
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: OpenImageDenoise

Post by Sharlybg »

Yes, all the time. Sounds much better than OIDN.
Hey your are fast :) The F1 season have not yet start :lol:
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: OpenImageDenoise

Post by lacilaci »

Sharlybg wrote: Sun Feb 03, 2019 5:30 pm
Yes, all the time. Sounds much better than OIDN.
Hey your are fast :) The F1 season have not yet start :lol:
lol, yes...

So, how long until this is usable in blendluxcore?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenImageDenoise

Post by Dade »

If you can convince B.Y.O.B. to add the support to BlendLuxCore, I guess one week for alpha0. PhotonGI is highly unfinished but it doesn't matter: some test can be already done.
Support LuxCoreRender project with salts and bounties
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: OpenImageDenoise

Post by alpistinho »

Hey,

I was hoping you could me help understand better these data structures.

I see that every Film object has several GenericFrameBuffer pointer that represent the multiple supported framebuffers. This class is templated to support multiple channels and multiple weight channels of type T.

To get the HDR output for the denoiser I've used the method described in the tutorial

Code: Select all

Spectrum *pixels = (Spectrum *)film.channel_IMAGEPIPELINEs[index]->GetPixels();
Since the channel_IMAGEPIPELINEs attribute vector of GenericFrameBuffer pointers, I assume it points to the several possible framebuffers that might exist in a given Film.
To get the pixels, the GetPixels method is called, that returns a reference to the internal GenericFrameBuffer object pixels

Code: Select all

const T *GetPixels() const { return &pixels[0]; }
T *GetPixels() { return &pixels[0]; }
...
std::vector<T> pixels;
As seen, this is a vector of the same type as instantiated by the Film class, usually a float.

When I've used this to get the HDR pixels it somehow works to cast this reference to a std::vector<float> to Spectrum*. Isn't Spectrum a completely different struct? Does it take advantage of the memory layout similarity between RGBColor and vector?

The ALBEDO and AVG_SHADING_NORMAL are both GenericFrameBuffers defined as:

Code: Select all

GenericFrameBuffer<4, 1, float>
I've tried to get the colors by copying the entire pixels vector while discarding every fourth value, that should be the weigth. But it is not working.
What am I missing?

Thanks for the help,

Daniel
Support LuxCoreRender project with salts and bounties
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: OpenImageDenoise

Post by Sharlybg »

PhotonGI is highly unfinished but it doesn't matter:
If we don't put Opencl in the box what kind of things are left for PGI cache ?
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenImageDenoise

Post by Dade »

Sharlybg wrote: Sun Feb 03, 2019 9:11 pm
PhotonGI is highly unfinished but it doesn't matter:
If we don't put Opencl in the box what kind of things are left for PGI cache ?
Volumes, transmission materials, tuning, optimization, etc.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenImageDenoise

Post by Dade »

alpistinho wrote: Sun Feb 03, 2019 9:08 pm The ALBEDO and AVG_SHADING_NORMAL are both GenericFrameBuffers defined as:

Code: Select all

GenericFrameBuffer<4, 1, float>
I've tried to get the colors by copying the entire pixels vector while discarding every fourth value, that should be the weigth. But it is not working.
What am I missing?
Each pixel in ALBEDO is an RGB color with [0.0, 1.0] values, each "pixel" AVG_SHADING_NORMAL is a FLOAT3 vector with values [-1.0, 1.0]. To get a pixel value (with all the weigh magic already done) just use GenericFrameBuffer::GetWeightedPixel(const u_int x, const u_int y, T *dst): https://github.com/LuxCoreRender/LuxCor ... fer.h#L266

You can set "dst" to the address of the pixel in the temporary vector<float> you are going to pass than to Oidn: something like "&albedo[pixelIndex * 3]"

P.S. if you want, just fill a GitHub pull request for LuxCore with your patch, I can add the ALBEDO/AVG_SHADING_NORMAL related stuff.
Support LuxCoreRender project with salts and bounties
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: OpenImageDenoise

Post by alpistinho »

Dade wrote: Sun Feb 03, 2019 11:01 pm P.S. if you want, just fill a GitHub pull request for LuxCore with your patch, I can add the ALBEDO/AVG_SHADING_NORMAL related stuff.
Thanks for the explanation.

I have opened the PR since I will have little time to look into this during the week and don't want to delay you for so little
Support LuxCoreRender project with salts and bounties
Post Reply