PCC / VCT hybrid progress
Last time I mentioned we were working on PCC / VCT Hybrid (PCC = Parallax Corrected Cubemaps, VCT = Voxel Cone Tracing).
I just implemented storing depth into the alpha channel, which is used to improve the quality of the hybrid.
Because we often use RGBA8 cubemaps, 8-bits is not enough to store the depth. Therefore we only store the deviation from the ideal probe shape.
The original PCC algorithm boils down to:
posInProbeShape = cameraCenter + reflDir * fDistance;
Where cameraCenter is artist-defined (where the PCC camera was placed to build the probe) and posInProbeShape is also artist-defined (by controlling the size of the probe)
PCC is about finding reflDir mathematically:
reflDir = (posInProbeShape - cameraCenter) / fDistance;
However we already know reflDir after executing PCC’s code.
Now the depth compression comes to effect by slightly altering the formula:
realReconstructedPosition = cameraCenter + reflDir * fDistance * depthDeviation;
The variable depthDeviation is in range [0; 2] (which we store in the alpha channel) and thus 8-bit should be enough.
Technically this could introduce a few artifacts because we only store the depth in range [0; maximum_distance * 2]
Storing the depth deviation dramatically improves the hybrid’s quality!
But let’s not rush.
(more…)