Yes, all the time. Sounds much better than OIDN.
OpenImageDenoise
Re: OpenImageDenoise
Anyway Odin is better to read than OIDNAnyone else always read "Odin" instead of "Oidn" ?
Re: OpenImageDenoise
Hey your are fast The F1 season have not yet startYes, all the time. Sounds much better than OIDN.
Re: OpenImageDenoise
lol, yes...
So, how long until this is usable in blendluxcore?
Re: OpenImageDenoise
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.
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: OpenImageDenoise
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
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
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:
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
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();
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;
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>
What am I missing?
Thanks for the help,
Daniel
Re: OpenImageDenoise
If we don't put Opencl in the box what kind of things are left for PGI cache ?PhotonGI is highly unfinished but it doesn't matter:
Re: OpenImageDenoise
Volumes, transmission materials, tuning, optimization, etc.
Re: OpenImageDenoise
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#L266alpistinho wrote: ↑Sun Feb 03, 2019 9:08 pm The ALBEDO and AVG_SHADING_NORMAL are both GenericFrameBuffers defined as:
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.Code: Select all
GenericFrameBuffer<4, 1, float>
What am I missing?
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.
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: OpenImageDenoise
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