SlideShare a Scribd company logo
Making Your Bokeh Fascinating
Real-time Rendering of Physically Based Optical Effect in Theory and Practice
SIGGRAPH 2015 Course
Masaki Kawase
Silicon Studio, Corp.
masa@siliconstudio.co.jp
Introduction
• Basic idea and theory [Kawase08]
– Only circular aperture
• Practical implementation and optimization [Kawase12]
– Any kind of aperture shapes
2
Contents
• Creating the Pencil Map
• Creating the Bundle-of-Light-Ray Map (Pencil Map)
– “Bundle of Light Rays” or “Pencil Rays”
(referred to as “Pencil” here onwards)
• Application to Arbitrary Aperture Shapes
• Scattering or Gathering?
• Results
• Conclusion
3
Creating the Pencil Map
Creating the Pencil Map
• Precompute light paths from the aberration diagram
– Takes spherical and axial chromatic aberrations into account
Light paths make up
pencil map
(small number of rays)
Longitudinal aberration
diagram
Pencil map
Amount of aberration
Incidentheight
5
Circular Bokeh Rendering
• V coordinate represents the distance from the optical axis
– Mapping each slice to a circle produces a circular ‘bokeh’
Pencil map
Circular bokeh
U: Distance from lens
V:Distancefrom
opticalaxis
6
Discretized Result…
7
• Chromatic aberration is an issue
• Three wavelengths (R/G/B) are insufficient to represent the
dispersion
Increasing Wavelength Samplings
• Calculate the map with more wavelengths
• Convert into the RGB space
8
3-Wavelength Samplings
9
Sufficient Wavelength Samplings
10
Bokeh with Spherical and Chromatic Aberration
• Imperfect focus
• Front bokeh with red sharp edge
• Back bokeh with blue soft edge
11
Zoomed-in view around the focal point
Comparison with photographs
Captured in real photographs
Generated from pencil map
12
Creating the Pencil Map of Doublet
13
• Calculate the map with the longitudinal aberration diagram
• Using actual lens parameters (if they exist)
– Only ray paths of each wavelength are required
Light paths make up
pencil map
Longitudinal aberration
diagram
Pencil map
Pencil Map of Doublet
Pencil maps and bokeh
Zoomed-in view around the focal point
14
Comparison with photographs
15
• Typical correction
– Front bokeh has soft purple edge and the center is darker
– Back bokeh has sharp green edge and the center is brighter
Front bokeh in photographs Back bokeh in photographs
Front and back Bokeh with Pencil map
Different Type of Doublet
• Residual chromatic aberration is more visible than
residual spherical aberration
Light paths make up
pencil map
Longitudinal aberration
diagram
Pencil map
16
Pencil Map of Doublet (Different Type)
Zoomed-in view around the focal point
Pencil maps and bokeh
17
Pencil Map of Doublet (Previous Type)
Pencil maps and bokeh
Zoomed-in view around the focal point
18
Comparison with photographs
Front bokeh in photographs Back bokeh in photographs
Front and back Bokeh with Pencil map
19
Optimization of Pencil Map
• Wasteful parts in the texture
– Sparse, many texels are empty
– There is not enough precision around the more important
‘focusing’ texels
Wasteful pencil map
20
Optimization of Pencil Map (cont’d)
• Normalizing height of bundle at every distance(u-axis)
by the maximum height(bokeh size)
• Less empty texels, and great improvement in precision
around focusing texels
Wasteful pencil map Normalized pencil map
21
Spherical lens (with no corrections)
Aspherical lens (chromatic aberration is not corrected)
Achromatic doublet lens
22
Achromatic doublet lens (different type)
Apochromatic (APO) lens
Perfect lens (does not actually exist)
23
Application to Arbitrary Aperture Shapes
Various Aperture Shapes
• Aperture shape is an important artistic factor
– Typically 5~9 diaphragm blades
– Changes from rounded to n-gon
• How to map pencil onto the polygonal aperture shape?
– 3D Textures?
• Too large, not practical
?
Pencil map
Aperture shape
25
Indirect Reference of Pencil Map
• Precompute an LUT texture that stores V coordinates of
pencil map
LUT texture
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
V
Vertical slice
26
Indirect Reference of Pencil Map (cont’d)
• Sample pencil map indirectly
at run-time
Pencil map
0
1
V
Look up
Sampling
LUT 27
Indirect Reference of Pencil Map (cont’d)
• LUT determines the aperture shape
– Independent of pencil map
– Can reproduce curved shapes of a diaphragm blade
• Prepare a set of LUTs for various diaphragm conditions
– Other shapes such as stars, hearts, … can be used
28
Various LUTs
• For the number of diaphragm blades and opening levels
• Smooth deformation is possible by interpolating between two adjacent LUTs
4 blades
5 blades
6 blades
7 blades
Fully opened ClosedClosing
29
Silhouette LUTs for debug
Fully opened
4 blades
5 blades
6 blades
7 blades
ClosedClosing
30
Scattering or Gathering?
Both can be Implemented
• Better quality by scattering
– Heavy processing load
• Hybrid method is recommended
– Both scattering and gathering
32
Hybrid Method
• To determine which pixels will be scattered or gathered,
use:
– The CoC size
– Difference in luminance between neighboring pixels
Original Result (green: gathering pixels)
33
34
Gathering
35
Hybrid of Scattering and Gathering
Optimization
• Use a half resolution buffer for scattering
– Scattering process can be 16x faster
• Split the process into several passes with
hierarchical resolution buffers
– Use lower resolution for larger bokeh
– The process at the 1/4 x 1/4 resolution can be 256x faster
• Scatter a pixel every 2x2 pixels
for relatively larger bokeh in each resolution
– Pixels that have an especially heavy processing load will be 4x faster
36
Results
Back bokeh with cyan fringes
Front bokeh with red/purple fringes
Bokeh Simulation in Real Time
Diaphragm Simulation
5-blade Aperture
Diaphragm Simulation
6-blade Aperture
Diaphragm Simulation
7-blade Aperture
Diaphragm Simulation
8-blade Aperture
Curved Diaphragm and Optical Vignetting
• Opening / Closing
– Deformation
• Circular aperture
• Polygonal aperture
– Rotation
– Optical Vignetting
• Cat’s Eye Effect
43
5-blade Circular Aperture (with Optical Vignetting)
f/1.4 (Fully Opened)
5-blade Circular Aperture (with Optical Vignetting)
f/2 (1 Stop Closed)
5-blade Circular Aperture (with Less Optical Vignetting)
f/2.8 (2 Stops Closed)
5-blade Circular Aperture (with No Optical Vignetting)
f/5.6 (4 Stops Closed)
5-blade Circular Aperture (with Fake Diffraction Spikes)
f/11 (6 Stops Closed)
Various Aberrations and Corrections
• Correction of SA and axial CA mostly affect bokeh
Focus plane
Back bokeh
Front bokeh
Differences between front and back bokeh
49
50
Spherical Lens (with No Corrections)
51
Aspherical Lens (with Chromatic Aberrations)
Correction of Spherical Aberration
52
Achromatic Lens
Corrected for Red and Blue Wavelengths
53
Achromatic Lens (Different Type)
Corrected for Red and Blue Wavelengths
54
APO (Apochromatic) Lens
Corrected for 3 Wavelengths (More Expensive Lens)
55
Almost Perfect Lens
Without any Spherical and Longitudinal Chromatic Aberrations
56
STF (Smooth Transition Focus) Lens
Soft Edged Bokeh by Apodization Optical Element
Radial gradient ND filter
Residual Aberration Visibility
Out of focus: Large
Aberrations: Less visible
Out of focus: Small
Aberrations: Strongly Visible
Residual Aberration Visibility
Out of focus: Large
Aberrations: Less visible
Out of focus: Small
Aberrations: Strongly Visible
Out of focus: Large
Aberrations: Less visible
Out of focus: Small
Aberrations: Strongly Visible
Comparison with Photographs (Achromat)
Real photographs with achromatic lensReal-time simulation results
59
Comparison with Photographs (APO)
Real photographs with apochromatic lensReal-time simulation results
60
Conclusion
Conclusion
• Reproduce photorealistic bokeh with pencil map and LUT
– Pencil map defines bokeh characteristics
– LUT defines bokeh shapes
• Optimization
– Various options available
– Combinations can be used to improve performance
62
References
• [Kawase08] Kawase, M. “Bokeh Expressions Based on Optics.” Computer Entertainment Developers
Conference, 2008.
• [Kawase12] Kawase, M. “Practical Implementation of Cinematic Lens Effects.” Computer
Entertainment Developers Conference, 2012.
• Kawase, M. “Reduce Artifacts Generated by Mipmapped Buffers.” Computer Entertainment Developers
Conference, 2009.
• Trávník, J. “On Bokeh.” Jakub Trávník's resources. http://jtra.cz/stuff/essays/bokeh/index.html
• 安藤幸司 『光と光の記録「レンズ編」』 AnfoWorld http://www.anfoworld.com/LensMF.html
• 吉田正太郎(1997)『カメラマンのための写真レンズの科学』地人書館.
63

More Related Content

PDF
チーム・ジャーニー 逆境を越える、変化に強いチームをつくりあげるまで
PDF
【Unite 2018 Tokyo】60fpsのその先へ!スマホの物量限界に挑んだSTG「アカとブルー」の開発設計
PPTX
大規模分散システムの現在 -- Twitter
PPTX
Anaconda navigatorのアップデートが終わらないときの対処方法メモ
PDF
徹底解説!UE4を使ったモバイルゲーム開発におけるコンテンツアップデートの極意!
PDF
FOSS4G OKINAWA QGIS入門編ワークショップ
PDF
Mask Material only in Early Z-passの効果と仕組み
PPTX
【DL輪読会】AuthenticAuthentic Volumetric Avatars from a Phone Scan
チーム・ジャーニー 逆境を越える、変化に強いチームをつくりあげるまで
【Unite 2018 Tokyo】60fpsのその先へ!スマホの物量限界に挑んだSTG「アカとブルー」の開発設計
大規模分散システムの現在 -- Twitter
Anaconda navigatorのアップデートが終わらないときの対処方法メモ
徹底解説!UE4を使ったモバイルゲーム開発におけるコンテンツアップデートの極意!
FOSS4G OKINAWA QGIS入門編ワークショップ
Mask Material only in Early Z-passの効果と仕組み
【DL輪読会】AuthenticAuthentic Volumetric Avatars from a Phone Scan

What's hot (20)

PPT
CEDEC 2009 Imagire Day 2009
PDF
Gazebo/ROSで力覚センサプラグインを使う
PDF
UE4勉強会 in 大阪 - アニメーション基礎
PPTX
大規模タイトルにおけるエフェクトマテリアル運用 (SQEX大阪: 林武尊様) #UE4DD
PDF
2014年5月21日「パーティクルフィルタの癖から知るロボットへの確率的手法の正しい適用方法」---第58回システム制御情報学会研究発表講演会チュートリアル講演
PPT
ロボット競技会向けリンク機構シミュレータ「Links」の紹介
PDF
UE4における大規模背景制作事例(コリジョン編)
PDF
UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -
PDF
QGISセミナー初級・実践編(V2.4)
PDF
「龍が如く7 光と闇の行方」の自動テスト活用事例とテスト自動化チーム(仮)による若手育成の取り組みについて
PPTX
BRDFモデルの変遷
PDF
アーティストの為のプロファイル入門!~楽しいRenderDocの使い方~
PDF
60fpsアクションを実現する秘訣を伝授 基礎編
PPTX
UnrealBuildTool勉強会まとめ
PPTX
[CEDEC2017] UE4プロファイリングツール総おさらい(グラフィクス編)
PDF
UE4における大規模レベル実装ワークフローとブループリント活用事例
PPTX
UE4におけるLoadingとGCのProfilingと最適化手法
PPTX
[DL輪読会]Objects as Points
PPTX
猫でも分かる UE4のAnimation Blueprintの運用について
CEDEC 2009 Imagire Day 2009
Gazebo/ROSで力覚センサプラグインを使う
UE4勉強会 in 大阪 - アニメーション基礎
大規模タイトルにおけるエフェクトマテリアル運用 (SQEX大阪: 林武尊様) #UE4DD
2014年5月21日「パーティクルフィルタの癖から知るロボットへの確率的手法の正しい適用方法」---第58回システム制御情報学会研究発表講演会チュートリアル講演
ロボット競技会向けリンク機構シミュレータ「Links」の紹介
UE4における大規模背景制作事例(コリジョン編)
UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -
QGISセミナー初級・実践編(V2.4)
「龍が如く7 光と闇の行方」の自動テスト活用事例とテスト自動化チーム(仮)による若手育成の取り組みについて
BRDFモデルの変遷
アーティストの為のプロファイル入門!~楽しいRenderDocの使い方~
60fpsアクションを実現する秘訣を伝授 基礎編
UnrealBuildTool勉強会まとめ
[CEDEC2017] UE4プロファイリングツール総おさらい(グラフィクス編)
UE4における大規模レベル実装ワークフローとブループリント活用事例
UE4におけるLoadingとGCのProfilingと最適化手法
[DL輪読会]Objects as Points
猫でも分かる UE4のAnimation Blueprintの運用について
Ad

Viewers also liked (19)

PDF
Lenses - Real-time Rendering of Physically Based Optical Effect in Theory an...
PDF
Subtle Anamorphic Lens Effects - Real-time Rendering of Physically Based Opt...
PDF
Recipes for Optical Effect System Design - Real-time Rendering of Physically...
PDF
VR音ゲーを楽しんでいたら VR音ゲーを作り始めていた話
PPTX
CEDEC 2011 コンピュータ・グラフィクス関連の最新論文紹介 ~Shape Matching法とその周辺技術~
PPT
CEDEC 2005 汎用的なシェーダ設計 イントロダクション
PPT
CEDEC 2008 Imagire Day 最新世代機に関わる技術トラック
PPT
CEDEC 2008 Imagire Day レンダリスト養成講座 2.0
PPT
CEDEC 2010 魅力ある絵作りのために知っておきたい色光学豆知識
PDF
物理ベース時代のライトマップベイク奮闘記
PDF
シリコンスタジオによる HDR出力対応の理論と実践
PDF
シリコンスタジオの最新テクノロジーデモ技術解説
PDF
機械学習向けCGデータの量産手法の検討
PPT
CEDEC 2009 Imagire Day 続・レンダリスト養成講座
PPT
CEDEC 2007 Imagire Day 最新世代機に関わる技術トラック
PPT
CEDEC 2007 ゲーム開発者向け最新技術論文の解説・実装講座
PPTX
CEDEC 2012 コンピュータ・グラフィクス関連の最新論文紹介~Modular Radiance Transfer法の解説~
PDF
CEDEC 2012 実践!シネマティックレンズエフェクト
PPTX
手描き感を再現する ペイントシミュレータの最新研究紹介
Lenses - Real-time Rendering of Physically Based Optical Effect in Theory an...
Subtle Anamorphic Lens Effects - Real-time Rendering of Physically Based Opt...
Recipes for Optical Effect System Design - Real-time Rendering of Physically...
VR音ゲーを楽しんでいたら VR音ゲーを作り始めていた話
CEDEC 2011 コンピュータ・グラフィクス関連の最新論文紹介 ~Shape Matching法とその周辺技術~
CEDEC 2005 汎用的なシェーダ設計 イントロダクション
CEDEC 2008 Imagire Day 最新世代機に関わる技術トラック
CEDEC 2008 Imagire Day レンダリスト養成講座 2.0
CEDEC 2010 魅力ある絵作りのために知っておきたい色光学豆知識
物理ベース時代のライトマップベイク奮闘記
シリコンスタジオによる HDR出力対応の理論と実践
シリコンスタジオの最新テクノロジーデモ技術解説
機械学習向けCGデータの量産手法の検討
CEDEC 2009 Imagire Day 続・レンダリスト養成講座
CEDEC 2007 Imagire Day 最新世代機に関わる技術トラック
CEDEC 2007 ゲーム開発者向け最新技術論文の解説・実装講座
CEDEC 2012 コンピュータ・グラフィクス関連の最新論文紹介~Modular Radiance Transfer法の解説~
CEDEC 2012 実践!シネマティックレンズエフェクト
手描き感を再現する ペイントシミュレータの最新研究紹介
Ad

Similar to Making Your Bokeh Fascinating - Real-time Rendering of Physically Based Optical Effect in Theory and Practice - SIGGRAPH 2015 Course (20)

PDF
Design and optimization of compact freeform lens array for laser beam splitti...
PPTX
Zeiss talk in summer 2022.pptx
PDF
Some odd and interesting monocentric designs 2005
PDF
Lens designs with extreme image quality features
PDF
3 D texturing
PPTX
Some unusual telescope designs
PPTX
Introduction to telescope design
PPTX
Some optical design tricks
PPTX
The evolution of a new high na broad spectrum catadioptric design
PPTX
Lens in a box
PPTX
Optical Design using stop shift theory
PPTX
Aberrations in optical aids
PPTX
New catadioptric design type fast speed and wide field
PPTX
Unusual mirror systems
PPTX
Gregorian telescope designs
PPTX
Class 7 presentation
PPTX
aberrations
PPT
Caustic Object Construction Based on Multiple Caustic Patterns
PPT
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
PDF
Modified freeform offner, august 11, 2021
Design and optimization of compact freeform lens array for laser beam splitti...
Zeiss talk in summer 2022.pptx
Some odd and interesting monocentric designs 2005
Lens designs with extreme image quality features
3 D texturing
Some unusual telescope designs
Introduction to telescope design
Some optical design tricks
The evolution of a new high na broad spectrum catadioptric design
Lens in a box
Optical Design using stop shift theory
Aberrations in optical aids
New catadioptric design type fast speed and wide field
Unusual mirror systems
Gregorian telescope designs
Class 7 presentation
aberrations
Caustic Object Construction Based on Multiple Caustic Patterns
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
Modified freeform offner, august 11, 2021

More from Silicon Studio Corporation (19)

PPTX
リアルタイムレイトレーシングを用いたNPRペイント風レンダリング|CEDEC2025
PPTX
地理空間情報のススメ!オープンデータ×データドリブンなプロシージャル処理による都市の樹木自動配置
PPTX
待望のNewバージョンを徹底解説!レンズ効果にこだわり続けるポストエフェクトミドルウェア「YEBIS」
PPTX
リアルタイム機械学習レンダリングのアプローチ:ポリゴン描画による 形状安定性とニューラルネット画像生成による高品質性を両立する手法
PPTX
リアルタイム光学エフェクトの深淵へ ~ 究極表現への道と位置 ~|CEDEC2024
PPTX
次世代 NPR の輪郭線表現に迫る!リアルタイムベクトルストローク生成手法 StrokeGen を徹底解剖
PPTX
ハイエンド〜ローエンドまで、「Enlighten」による効率的リアルタイムグローバルイルミネーション|CEDEC2023
PPTX
Procedural PLATEAU: プロシージャル技術と3D都市モデル「Project PLATEAU」を組み合わせたファサード自動生成と テクスチャ...
PPTX
ハイエンド〜ローエンドまで、「Enlighten」による効率的リアルタイムグローバルイルミネーション
PDF
待望のメジャーアップデート!Enlighten 4 レイトレなど最新機能ご紹介
PDF
3DCG住宅プレゼンテーションのグローバルイルミネーションをディープラーニングで推定!
PDF
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
PDF
Unreal Engine を用いた、駐車スペース検知のための学習データ生成
PPTX
エンド・トゥ・エンドAI描画に至る道 - 高度構造化入力のためのニューラルネットワーク構成やインフラの検討 -
PDF
シリコンスタジオで開発中の Mizuchi for DCC Tool について
PDF
物理ベース?アート指向? ~尤もらしさと自由度を両立するレンズフレア表現
PDF
実践的なHDR出力対応 ~レンダリングパイプラインの構築~
PDF
4Front Game Data Science
PDF
Churn Prediction in Mobile Social Games: Towards a Complete Assessment Using ...
リアルタイムレイトレーシングを用いたNPRペイント風レンダリング|CEDEC2025
地理空間情報のススメ!オープンデータ×データドリブンなプロシージャル処理による都市の樹木自動配置
待望のNewバージョンを徹底解説!レンズ効果にこだわり続けるポストエフェクトミドルウェア「YEBIS」
リアルタイム機械学習レンダリングのアプローチ:ポリゴン描画による 形状安定性とニューラルネット画像生成による高品質性を両立する手法
リアルタイム光学エフェクトの深淵へ ~ 究極表現への道と位置 ~|CEDEC2024
次世代 NPR の輪郭線表現に迫る!リアルタイムベクトルストローク生成手法 StrokeGen を徹底解剖
ハイエンド〜ローエンドまで、「Enlighten」による効率的リアルタイムグローバルイルミネーション|CEDEC2023
Procedural PLATEAU: プロシージャル技術と3D都市モデル「Project PLATEAU」を組み合わせたファサード自動生成と テクスチャ...
ハイエンド〜ローエンドまで、「Enlighten」による効率的リアルタイムグローバルイルミネーション
待望のメジャーアップデート!Enlighten 4 レイトレなど最新機能ご紹介
3DCG住宅プレゼンテーションのグローバルイルミネーションをディープラーニングで推定!
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
Unreal Engine を用いた、駐車スペース検知のための学習データ生成
エンド・トゥ・エンドAI描画に至る道 - 高度構造化入力のためのニューラルネットワーク構成やインフラの検討 -
シリコンスタジオで開発中の Mizuchi for DCC Tool について
物理ベース?アート指向? ~尤もらしさと自由度を両立するレンズフレア表現
実践的なHDR出力対応 ~レンダリングパイプラインの構築~
4Front Game Data Science
Churn Prediction in Mobile Social Games: Towards a Complete Assessment Using ...

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Mechanical Engineering MATERIALS Selection
PDF
Digital Logic Computer Design lecture notes
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
Project quality management in manufacturing
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
PPT on Performance Review to get promotions
PPTX
additive manufacturing of ss316l using mig welding
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
web development for engineering and engineering
Internet of Things (IOT) - A guide to understanding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mechanical Engineering MATERIALS Selection
Digital Logic Computer Design lecture notes
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Project quality management in manufacturing
Model Code of Practice - Construction Work - 21102022 .pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Geodesy 1.pptx...............................................
UNIT 4 Total Quality Management .pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Structs to JSON How Go Powers REST APIs.pdf
PPT on Performance Review to get promotions
additive manufacturing of ss316l using mig welding
OOP with Java - Java Introduction (Basics)
web development for engineering and engineering

Making Your Bokeh Fascinating - Real-time Rendering of Physically Based Optical Effect in Theory and Practice - SIGGRAPH 2015 Course

  • 1. Making Your Bokeh Fascinating Real-time Rendering of Physically Based Optical Effect in Theory and Practice SIGGRAPH 2015 Course Masaki Kawase Silicon Studio, Corp. masa@siliconstudio.co.jp
  • 2. Introduction • Basic idea and theory [Kawase08] – Only circular aperture • Practical implementation and optimization [Kawase12] – Any kind of aperture shapes 2
  • 3. Contents • Creating the Pencil Map • Creating the Bundle-of-Light-Ray Map (Pencil Map) – “Bundle of Light Rays” or “Pencil Rays” (referred to as “Pencil” here onwards) • Application to Arbitrary Aperture Shapes • Scattering or Gathering? • Results • Conclusion 3
  • 5. Creating the Pencil Map • Precompute light paths from the aberration diagram – Takes spherical and axial chromatic aberrations into account Light paths make up pencil map (small number of rays) Longitudinal aberration diagram Pencil map Amount of aberration Incidentheight 5
  • 6. Circular Bokeh Rendering • V coordinate represents the distance from the optical axis – Mapping each slice to a circle produces a circular ‘bokeh’ Pencil map Circular bokeh U: Distance from lens V:Distancefrom opticalaxis 6
  • 7. Discretized Result… 7 • Chromatic aberration is an issue • Three wavelengths (R/G/B) are insufficient to represent the dispersion
  • 8. Increasing Wavelength Samplings • Calculate the map with more wavelengths • Convert into the RGB space 8
  • 11. Bokeh with Spherical and Chromatic Aberration • Imperfect focus • Front bokeh with red sharp edge • Back bokeh with blue soft edge 11 Zoomed-in view around the focal point
  • 12. Comparison with photographs Captured in real photographs Generated from pencil map 12
  • 13. Creating the Pencil Map of Doublet 13 • Calculate the map with the longitudinal aberration diagram • Using actual lens parameters (if they exist) – Only ray paths of each wavelength are required Light paths make up pencil map Longitudinal aberration diagram Pencil map
  • 14. Pencil Map of Doublet Pencil maps and bokeh Zoomed-in view around the focal point 14
  • 15. Comparison with photographs 15 • Typical correction – Front bokeh has soft purple edge and the center is darker – Back bokeh has sharp green edge and the center is brighter Front bokeh in photographs Back bokeh in photographs Front and back Bokeh with Pencil map
  • 16. Different Type of Doublet • Residual chromatic aberration is more visible than residual spherical aberration Light paths make up pencil map Longitudinal aberration diagram Pencil map 16
  • 17. Pencil Map of Doublet (Different Type) Zoomed-in view around the focal point Pencil maps and bokeh 17
  • 18. Pencil Map of Doublet (Previous Type) Pencil maps and bokeh Zoomed-in view around the focal point 18
  • 19. Comparison with photographs Front bokeh in photographs Back bokeh in photographs Front and back Bokeh with Pencil map 19
  • 20. Optimization of Pencil Map • Wasteful parts in the texture – Sparse, many texels are empty – There is not enough precision around the more important ‘focusing’ texels Wasteful pencil map 20
  • 21. Optimization of Pencil Map (cont’d) • Normalizing height of bundle at every distance(u-axis) by the maximum height(bokeh size) • Less empty texels, and great improvement in precision around focusing texels Wasteful pencil map Normalized pencil map 21
  • 22. Spherical lens (with no corrections) Aspherical lens (chromatic aberration is not corrected) Achromatic doublet lens 22
  • 23. Achromatic doublet lens (different type) Apochromatic (APO) lens Perfect lens (does not actually exist) 23
  • 24. Application to Arbitrary Aperture Shapes
  • 25. Various Aperture Shapes • Aperture shape is an important artistic factor – Typically 5~9 diaphragm blades – Changes from rounded to n-gon • How to map pencil onto the polygonal aperture shape? – 3D Textures? • Too large, not practical ? Pencil map Aperture shape 25
  • 26. Indirect Reference of Pencil Map • Precompute an LUT texture that stores V coordinates of pencil map LUT texture 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 V Vertical slice 26
  • 27. Indirect Reference of Pencil Map (cont’d) • Sample pencil map indirectly at run-time Pencil map 0 1 V Look up Sampling LUT 27
  • 28. Indirect Reference of Pencil Map (cont’d) • LUT determines the aperture shape – Independent of pencil map – Can reproduce curved shapes of a diaphragm blade • Prepare a set of LUTs for various diaphragm conditions – Other shapes such as stars, hearts, … can be used 28
  • 29. Various LUTs • For the number of diaphragm blades and opening levels • Smooth deformation is possible by interpolating between two adjacent LUTs 4 blades 5 blades 6 blades 7 blades Fully opened ClosedClosing 29
  • 30. Silhouette LUTs for debug Fully opened 4 blades 5 blades 6 blades 7 blades ClosedClosing 30
  • 32. Both can be Implemented • Better quality by scattering – Heavy processing load • Hybrid method is recommended – Both scattering and gathering 32
  • 33. Hybrid Method • To determine which pixels will be scattered or gathered, use: – The CoC size – Difference in luminance between neighboring pixels Original Result (green: gathering pixels) 33
  • 35. 35 Hybrid of Scattering and Gathering
  • 36. Optimization • Use a half resolution buffer for scattering – Scattering process can be 16x faster • Split the process into several passes with hierarchical resolution buffers – Use lower resolution for larger bokeh – The process at the 1/4 x 1/4 resolution can be 256x faster • Scatter a pixel every 2x2 pixels for relatively larger bokeh in each resolution – Pixels that have an especially heavy processing load will be 4x faster 36
  • 38. Back bokeh with cyan fringes Front bokeh with red/purple fringes Bokeh Simulation in Real Time
  • 43. Curved Diaphragm and Optical Vignetting • Opening / Closing – Deformation • Circular aperture • Polygonal aperture – Rotation – Optical Vignetting • Cat’s Eye Effect 43
  • 44. 5-blade Circular Aperture (with Optical Vignetting) f/1.4 (Fully Opened)
  • 45. 5-blade Circular Aperture (with Optical Vignetting) f/2 (1 Stop Closed)
  • 46. 5-blade Circular Aperture (with Less Optical Vignetting) f/2.8 (2 Stops Closed)
  • 47. 5-blade Circular Aperture (with No Optical Vignetting) f/5.6 (4 Stops Closed)
  • 48. 5-blade Circular Aperture (with Fake Diffraction Spikes) f/11 (6 Stops Closed)
  • 49. Various Aberrations and Corrections • Correction of SA and axial CA mostly affect bokeh Focus plane Back bokeh Front bokeh Differences between front and back bokeh 49
  • 50. 50 Spherical Lens (with No Corrections)
  • 51. 51 Aspherical Lens (with Chromatic Aberrations) Correction of Spherical Aberration
  • 52. 52 Achromatic Lens Corrected for Red and Blue Wavelengths
  • 53. 53 Achromatic Lens (Different Type) Corrected for Red and Blue Wavelengths
  • 54. 54 APO (Apochromatic) Lens Corrected for 3 Wavelengths (More Expensive Lens)
  • 55. 55 Almost Perfect Lens Without any Spherical and Longitudinal Chromatic Aberrations
  • 56. 56 STF (Smooth Transition Focus) Lens Soft Edged Bokeh by Apodization Optical Element Radial gradient ND filter
  • 57. Residual Aberration Visibility Out of focus: Large Aberrations: Less visible Out of focus: Small Aberrations: Strongly Visible
  • 58. Residual Aberration Visibility Out of focus: Large Aberrations: Less visible Out of focus: Small Aberrations: Strongly Visible Out of focus: Large Aberrations: Less visible Out of focus: Small Aberrations: Strongly Visible
  • 59. Comparison with Photographs (Achromat) Real photographs with achromatic lensReal-time simulation results 59
  • 60. Comparison with Photographs (APO) Real photographs with apochromatic lensReal-time simulation results 60
  • 62. Conclusion • Reproduce photorealistic bokeh with pencil map and LUT – Pencil map defines bokeh characteristics – LUT defines bokeh shapes • Optimization – Various options available – Combinations can be used to improve performance 62
  • 63. References • [Kawase08] Kawase, M. “Bokeh Expressions Based on Optics.” Computer Entertainment Developers Conference, 2008. • [Kawase12] Kawase, M. “Practical Implementation of Cinematic Lens Effects.” Computer Entertainment Developers Conference, 2012. • Kawase, M. “Reduce Artifacts Generated by Mipmapped Buffers.” Computer Entertainment Developers Conference, 2009. • Trávník, J. “On Bokeh.” Jakub Trávník's resources. http://jtra.cz/stuff/essays/bokeh/index.html • 安藤幸司 『光と光の記録「レンズ編」』 AnfoWorld http://www.anfoworld.com/LensMF.html • 吉田正太郎(1997)『カメラマンのための写真レンズの科学』地人書館. 63