Implementing Different Algorithms to mimic Bokeh Depth Of Field: A Physical Camera Effect created due to Focal Length, Aperture size, shape
This Project is using The Forge Rendering API, a cross-platform rendering, and targeted for these devices: PC, Android, macOS, IOS, IPad OS devices.
❗️❗️ This Project is Further Developed on The Forge Rendering API as a UnitTest and no longer maintained in this repository page. But Shaders are always up to date :) ❗️❗️
To mimic the physical camera in real-time in an efficient way to reduce postfx overheads.
Here is the 3 different methods implemented explained briefly:
I will soon write a blog post with a lot more detail and pros-and-cons on it.
Circular Sperable DOF by Kleber Garcia at Frostbite EA which was shipped with FIFA17 , NHS, Mass Effect Andromeda, Anthem and is going to be shipped with the new Need For Speed Heat.
This technique is a seperable convolution filter like the Gaussian Filter and this makes it super faster than the "1-Pass 2D Kernel".
Derivation of the Kernel Weights and the Math includes Complex Numbers and Fourier Transforms explained in Olli Niemitalo's blog post.
In his paper some important notes were missing like how we do the "blending" so I had to get creative and do a lot of thinking myself.
This method is operating on Near, Far Field Seperatly on multiple passes
Practical Gather-Based Depth of Field which is fully described in GPU-Zen Book.
This approach is also Gather-Based but the sampling and computation is not seperable and is circular sampling with 48 samples.
Depth of Field in a Single Pass which is described in Dennis Gustafsson awsome blog post.
This Depth of Field effect is done in a Single Pass.
Due to this technique being in full-res and needing a lot more sample and calculations It performance is now worse than the other two.
There are a lot of optimizations for this technique but since I forced it to be in a single pass my hands were tight (by myself).
Report any bug on your devices with most detail here
All Bokeh Links and Book Chapters gathered for R&D are in this github gist; for detailed resources and links see below:
Implementing Different Methods of Circle to Circle Collision Detection using variety of new Technologies: Vulkan Graphics/Compute API, AVX2/AVX-512
Graphic Techniques Implemented on The Forge API, a cross-platform rendering framework on top of Vulkan, DirectX, Metal