Website powered by

Voxel-based scene AO effect

This is Ambient Occlusion baking system in Unity Engine using spherical voxels as approximation of models. I created it for Gloria Victis MMORPG.

Voxel layout computation happens manually in editor or in case of scenes it happens automatically during scene save.
In game mode scenes or prefabs with voxel data are being streamed around player and data is being asynchronously consolidated into one collection available for AO computation.

AO computation itself also happens asynchronously (Unity Jobs system) and utilizes custom raycasting (a few spherical directions) against voxels. Raycasts start positions are located around all voxels, but only in locations that are directly near them, thanks to that raycasting uses minimal amount of rays.

The result of this raycasting is a collection that later on gets turned into 3D texture used directly in post-process effect on camera.

City scene with effect ON

City scene with effect ON

AO visualization

AO visualization

City scene with effect OFF

City scene with effect OFF

Example of voxelization, only a simple approximation is required to make AO work.

Example of voxelization, only a simple approximation is required to make AO work.