Commit Graph

9 Commits

Author SHA1 Message Date
Бранимир Караџић
19fe73d00d Cleanup. 2021-04-18 21:16:56 -07:00
Hugo Amnov
daad11fa0c
Fix 43-denoise when FB format invalid (#2480) 2021-04-18 21:14:57 -07:00
Бранимир Караџић
45234794d9 Don't interact with camera when mouse is over ImGui. 2021-02-05 17:24:56 -08:00
elvencache
4d272f4104
bokeh depth of field (#2372)
* Implement bokeh depth of field

Implement bokeh depth of field as described in the blog post here:
https://blog.tuxedolabs.com/2018/05/04/bokeh-depth-of-field-in-single-pass.html

Additionally, implement the optimizations discussed in the closing paragraph. Apply the effect in multiple passes. Calculate the circle of confusion and store in the alpha channel while downsampling the image. Then compute depth of field at this lower res, storing sample size in alpha. Then composite the blurred image, based on the sample size. Compositing the lower res like this can lead to blocky edges where there's a depth discontinuity and the blur is just enough. May be an area to improve on.

Provide an alternate means of determining radius of current sample when blurring. I find the blog post's sample pattern to be difficult to directly reason about. It is not obvious, given the parameters, how many samples will be taken. And it can be very many samples. Though the results are good. The 'sqrt' pattern chosen here looks alright and allows for the number of samples to be set directly. If you are going to use this in a project, may be worth exploring additional sample patterns. And certainly update the shader to remove the pattern choice from inside the sample loop.

* fix typo in shader of denoise example

copy/paste error, applying y offset to x component instead
2021-01-31 09:59:55 -08:00
Бранимир Караџић
3202330daa 43-denoise: Removed alpha from screenshot. 2021-01-02 11:35:21 -08:00
Бранимир Караџић
fa3aed3b0b 43-denoise: Updated references. 2021-01-02 11:23:13 -08:00
Бранимир Караџић
cbccb2386a 43-denoise: Style cleanup. Added screenshot. 2021-01-02 11:12:45 -08:00
Бранимир Караџић
27de3100b7 43-denoise: Switched depth to D32F format. 2021-01-02 10:52:19 -08:00
Branimir Karadžić
4760628bb1 43-denoise: Added shaders. 2021-01-02 10:46:43 -08:00