Camera non uniform bokeh support

Discussion related to the LuxCore functionality, implementations and API.
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Camera non uniform bokeh support

Post by kintuX »

Dade wrote: Wed Jul 29, 2020 12:20 pm
Dade wrote: Wed Jul 29, 2020 10:25 am P.S. chafouin, after having seen your link to http://richardrosenman.com/shop/dof-pro, I have changed my mind and I will add the support for bokeh with custom images ... this stuff is too cool.
HAHA, how crazy is this thing :lol:

I added the support for bokeh custom distribution...

Note: I have written the CPU code, I have still to write the GPU one.
Will there be RGB tex support or BW/grayscale only?

Note: RGB support also allows creation of chromatic aberration for that extra realistic touch. And becomes especially valuable when you know about Out-of-focus point spread functions (paper) ;)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Camera non uniform bokeh support

Post by Dade »

kintuX wrote: Wed Jul 29, 2020 4:16 pm Will there be RGB tex support or BW/grayscale only?
It is a weight so it is gray scale only.
kintuX wrote: Wed Jul 29, 2020 4:16 pm Note: RGB support also allows creation of chromatic aberration for that extra realistic touch. And becomes especially valuable when you know about Out-of-focus point spread functions (paper) ;)
The paper seems impossible to download.
Support LuxCoreRender project with salts and bounties
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Camera non uniform bokeh support

Post by chafouin »

This is awesome!

I think RGB bokeh shape would be nice to have, but if you get proper longitudinal achromatic aberration in front and back bokeh, as well as chromatic aberration (that you already added in the imagepipeline), this is less required.

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

Re: Camera non uniform bokeh support

Post by kintuX »

Dade wrote: Wed Jul 29, 2020 6:06 pm
kintuX wrote: Wed Jul 29, 2020 4:16 pm Will there be RGB tex support or BW/grayscale only?
It is a weight so it is gray scale only.
kintuX wrote: Wed Jul 29, 2020 4:16 pm Note: RGB support also allows creation of chromatic aberration for that extra realistic touch. And becomes especially valuable when you know about Out-of-focus point spread functions (paper) ;)
The paper seems impossible to download.
Strange :? maybe it takes some time... anyways I re-hosted it on wetransfer - OOF PSF ~10MB (slides & paper)
Original source @ http://aggregate.org/
February 4-5, 2014 Prof. Dietz presented two papers and a research exhibit at the SPIE Electronic Imaging conference: Out-of-focus point spread functions (slides, full paper) and Frameless, time domain continuous image capture (slides, full paper).
Edit/
Here's an example made with Corona
- input image
logoRGBc.jpg
- render
logoRGB_CA_crn.jpg
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Camera non uniform bokeh support

Post by chafouin »

While it can fake chromatic aberrations and has been used in the past in many engines, it is not the correct and physical way to create chromatic or achromatic aberrations.

The current color aberrations only allow for purple and green, while these are usually more red and blue. Is it possible to give control over the affected channels?

Green and purple are more visible in achromatic aberrations (front/back focus bokeh) which adds a lot of realism to scenes. This plus optical vignetting (cat's eye effect) and tangential astigmatism (swirly bokeh), and you get everything you need to recreate a lens.

Purple fringing created by digital sensors are created in areas of high contrasts and can be done in compositing, but it could be nice to have it in the image pipeline as well. Soft corners is also a simple effect but could be added to the image pipeline. Then we can start making lens presets with different visual signatures :)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Camera non uniform bokeh support

Post by B.Y.O.B. »

It seems to me like an RGB bokeh image makes no sense if you want to emulate chromatic aberration, because getting color shifts from an RGB image would mean that it is constant over the whole film plane, which is not the case in realistic chromatic aberration.

On another note, having the "cat-eye" effect for bokeh would be a nice feature as well, not sure how hard that would be to add. Is the sample position on the film plane known when evaluating the bokeh distribution?
jgrover110
Posts: 47
Joined: Tue Apr 17, 2018 1:07 pm

Re: Camera non uniform bokeh support

Post by jgrover110 »

Longitudinal chromatic aberration needs that colour fringing around the bokeh, and for it to shift depending on the distance from the focal point. Hopefully this is possible as the effect is very realistic
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Camera non uniform bokeh support

Post by Dade »

I added the support for custom bokeh to GPU code.

About bokeh chromatic aberation: current internal camera interface only returns a ray (not a color) so it is not possible to have chromatic aberation inside the boundary of the current interface. Indeed, the interface can be extend, but it is more work.
Support LuxCoreRender project with salts and bounties
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Camera non uniform bokeh support

Post by kintuX »

Dade wrote: Thu Jul 30, 2020 1:36 pm I added the support for custom bokeh to GPU code.
Thank you.
About bokeh chromatic aberration: current internal camera interface only returns a ray (not a color) so it is not possible to have chromatic aberration inside the boundary of the current interface. Indeed, the interface can be extend, but it is more work.
Yup, that's how everyone does it, except Corona. ;)
B.Y.O.B. wrote: Thu Jul 30, 2020 10:52 am It seems to me like an RGB bokeh image makes no sense if you want to emulate chromatic aberration, because getting color shifts from an RGB image would mean that it is constant over the whole film plane, which is not the case in realistic chromatic aberration.

On another note, having the "cat-eye" effect for bokeh would be a nice feature as well, not sure how hard that would be to add. Is the sample position on the film plane known when evaluating the bokeh distribution?
True, the best would be something alike Lentil - Lenses for Path Tracers (for Arnold)*.
Still, so called "RGB bokeh" is second best as it can create lens FX in "visual accordance" to camera settings which takes focal point, DOF, film size, aperture image, dirt map... all into account and could even generate flare and glare. Also, it's dumb simple to use.
But indeed for time being, out-of-scope for LuxCore.

Edit:
*Lentil is an evolution of POTA (Polynomial Optics To Arnold) an open source camera shader... based on 2016 Sparse high-degree polynomials for wide-angle lenses (paper)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Camera non uniform bokeh support

Post by B.Y.O.B. »

The Blender addon now has support for custom bokeh images.
Post Reply