buildaworldnet / IrrlichtBAW

Build A World fork of Irrlicht
http://www.buildaworld.net
Apache License 2.0
122 stars 28 forks source link

Add a DoF example #140

Open devshgraphicsprogramming opened 6 years ago

devshgraphicsprogramming commented 6 years ago

Circle of Confusion equation

CoC = abs(z * CoCScale + CoCBias) 
CoCScale = (A * focallength * focalplane * (zfar - znear)) / ((focalplane - focallength) * znear * zfar) 
CoCBias = (A * focallength * (znear - focalplane )) / ((focalplane * focallength) * znear)

Use a summed area table to implement the blur

Ideas to explore:

  1. Use multi-resolution targets for blurring
  2. Explore blur raidus given by the sample's CoC not the center pixel's CoC (color premultiplication, storing CoC in alpha)
  3. Use atomic operations and ARB_shader_ballot and the like for an emulated append buffer for Bokeh
devshgraphicsprogramming commented 3 years ago

Add to "recruitment task" stack @AnastaZIuk