Hello,
found a discussion about the DoF implementation
https://de.slideshare.net/TiagoAlexSousa/graphics-gems-from-cryengine-3-siggraph-2013
in Cryengine 3 here
https://www.gamedev.net/forums/topic/675214-dof-near-field-bleeding/
but unfortunately the thread was already closed.
Have some questions and hopefully someone is still around who can answer them
1. Slide 36:
I guess this describes how to compute the 49 sample offsets for the 7x7 kernel? I.e. how to compute the final morphed radius and angle for a sample relative to the current center pixel? So this could be done once on the CPU, compute radius and angle for all 49 samples and upload a uniform array with the x,y offsets for each position derived from the angle and radius?
2. Slide 37:
How exactly does the flood-fill-pass work? What are the offsets for taking 3x3 samples or do we just sample the 3x3 pixels around each current center pixel? And do we take the maximum/brightest color of the 9 samples to approx boolean union? If yes, how do we comoute which of the 9 RGB colors is "the brightest"?
3. Slide 41:
Honestly I don't get what this "tile count" stuff is? What tiles are they talking about? Where does the tile count come from? I guess we have some R8G8 renderbuffer which we want to fill with something. Our input renderbuffer contains the fullres COC as A8 or float texture (don't know what format is proposed to store the COC values)? What exactly are we doing when downscaling tilecount-times? What is this downscale shader doing during each tilecount-pass? Does it start with fullres or halfres input which is mentioned in the slides?
4. Slide 42:
How does this custom bilateral filter look like? Is there an implementation available? Does this filter downscale only color or also COC?
Does "weight samples with far COC" mean each sample color is multiplied with the COC of the sample (taken from half res input)?
What does "pre-multiply layer with far COC" mean? Is "layer" the half res color input? Or the full res input before the bilateral downscale? Do we AGAIN multiply colors with COC although we do this already when we "weight samples"?
5. Slide 44:
How does the upscale bilateral filter work? For each fullres pixel we take 4 taps from halfres and do some magic based on the COC values? We do this "somehow" in a bicubic quality manner? And then blend based on far COC? Is far COC betwee 0.0 and 1.0?
Ok a lot of questions I know ;( But help is really appreciated!