Page 1 of 4

Camera non uniform bokeh support

Posted: Thu Jul 23, 2020 1:03 pm
by Dade
The v2.5 branch has now the support for camera non uniform bokeh (from issue https://github.com/LuxCoreRender/LuxCore/issues/409).

It can be enabled with the following camera properties:

Code: Select all

# Number of camera blades (must be > 3 to enable bokeh)
scene.camera.bokeh.blades = 6
# NONE, UNIFORM, EXPONENTIAL, INVERSEEXPONENTIAL, GAUSSIAN, INVERSEGAUSSIAN or TRIANGULAR
scene.camera.bokeh.distribution.type = EXPONENTIAL
# Distribution power, 0 or more, affects only EXPONENTIAL and INVERSEEEXPONENTIAL distributions
scene.camera.bokeh.power = 0
# For anamorphic bokeh, the scale vector is normalized (so the length doesn't matter)
scene.camera.bokeh.scale.x = 1
scene.camera.bokeh.scale.y = 1
They affects only perspective cameras.

It can produce many types of bokeh effects:

bokeh1.jpg
bokeh2.jpg
bokeh3.jpg
Old LuxRender wiki has a quite comprensive explanation of bokeh: https://web.archive.org/web/20161014045 ... ld_of_View

Re: Camera non uniform bokeh support

Posted: Thu Jul 23, 2020 1:55 pm
by jgrover110
Is it possible to create an oval aperture for anamorphic bokeh?

Re: Camera non uniform bokeh support

Posted: Thu Jul 23, 2020 2:49 pm
by Dade
jgrover110 wrote: Thu Jul 23, 2020 1:55 pm Is it possible to create an oval aperture for anamorphic bokeh?
I can add an option for anisotropic bokeh :idea:

Re: Camera non uniform bokeh support

Posted: Thu Jul 23, 2020 3:11 pm
by Sharlybg
Awesome ! 2.5 will be famous :geek:

Re: Camera non uniform bokeh support

Posted: Thu Jul 23, 2020 4:11 pm
by tokiop
Nice feature, thanks Dade! On the subject, some renderers can make use of an "aperture map", an image texture providing the bokeh shape, for example to produce "heart bokeh", or simlate imperfections. Not sure how useful it is, but being able to provide a map is user friendly.

Re: Camera non uniform bokeh support

Posted: Fri Jul 24, 2020 11:42 am
by Dade
Dade wrote: Thu Jul 23, 2020 2:49 pm
jgrover110 wrote: Thu Jul 23, 2020 1:55 pm Is it possible to create an oval aperture for anamorphic bokeh?
I can add an option for anisotropic bokeh :idea:
Done:

Code: Select all

scene.camera.bokeh.blades = 64
scene.camera.bokeh.distribution.type = UNIFORM
scene.camera.bokeh.scale.x = 1
scene.camera.bokeh.scale.y = 3
bokeh4.jpg

Re: Camera non uniform bokeh support

Posted: Fri Jul 24, 2020 11:43 am
by Dade
tokiop wrote: Thu Jul 23, 2020 4:11 pm Nice feature, thanks Dade! On the subject, some renderers can make use of an "aperture map", an image texture providing the bokeh shape, for example to produce "heart bokeh", or simlate imperfections. Not sure how useful it is, but being able to provide a map is user friendly.
It is possible but not trivial, we can add it if there is enough demand in the future.

Re: Camera non uniform bokeh support

Posted: Fri Jul 24, 2020 12:43 pm
by Sharlybg
It is possible but not trivial, we can add it if there is enough demand in the future.
These day where i want to clone you :mrgreen:

Re: Camera non uniform bokeh support

Posted: Fri Jul 24, 2020 7:19 pm
by jgrover110
Dade wrote: Fri Jul 24, 2020 11:42 am
Dade wrote: Thu Jul 23, 2020 2:49 pm
jgrover110 wrote: Thu Jul 23, 2020 1:55 pm Is it possible to create an oval aperture for anamorphic bokeh?
I can add an option for anisotropic bokeh :idea:
Done:

Code: Select all

scene.camera.bokeh.blades = 64
scene.camera.bokeh.distribution.type = UNIFORM
scene.camera.bokeh.scale.x = 1
scene.camera.bokeh.scale.y = 3

bokeh4.jpg
Thank you! :D

Re: Camera non uniform bokeh support

Posted: Mon Jul 27, 2020 12:03 am
by Shantarli
This is great, thanks a lot for your work <3 Can't wait B.Y.O.B. to enable this feature in BlendLuxCore in some "pre-alpha 2.5" build :)