Initial code for building 3D texture.

Implementing initial code for calculating 3D occlusion texture and
fixing a bug with calculateCoverage.