This pull request implements clipmaps for Ambient Occlusion.
The traceAO function uses some code from WickedEngine, and I implemented the corresponding clipmapping mechanism in the rendering pipeline and the voxelizer i.e. there isn't a voxpos variable anymore, clipmap_center (formerly eyeSnap) and clipmapLevel are passed to the conetracer which will handles things from here.
It comes with two new options: voxel size and clipmap count.
Size (in the ray panel) with scale the individual voxels, which being multiplied by the resolution, determine the extent of the grids. They are uniform across both the voxelizer and the conetracer for seamless transitions between lods.
Clipmap count is the number of grids, each one being twice as big than the preceding one, for a total extent of voxelSize resolution pow(2.0, clipmap_count);
Around camera, and revoxelize options have been removed:
Revoxelize / around camera are not relevant in case of clipmapping where we constantly need to revoxelize taking into account the distance from the eye to the vertex.
Note about the temporal filter: I'm not sure this is a good thing to use. In my tests it skipped too many frames and there were screen artifacts. Maybe reducing the frequency can help but in anyway doing twice as much conetracing isn't worth saving a few voxelization frames and it ends up being unstable and slower. Don't use it for now.
You'll see a lot of code that seems unnecessary and it's because I first implemented GI & AO, then removed the GI part and am leaving the code ready for implementation of global illumination.
This pull request implements clipmaps for Ambient Occlusion.
The traceAO function uses some code from WickedEngine, and I implemented the corresponding clipmapping mechanism in the rendering pipeline and the voxelizer i.e. there isn't a voxpos variable anymore, clipmap_center (formerly eyeSnap) and clipmapLevel are passed to the conetracer which will handles things from here.
It comes with two new options: voxel size and clipmap count.
Around camera, and revoxelize options have been removed:
Note about the temporal filter: I'm not sure this is a good thing to use. In my tests it skipped too many frames and there were screen artifacts. Maybe reducing the frequency can help but in anyway doing twice as much conetracing isn't worth saving a few voxelization frames and it ends up being unstable and slower. Don't use it for now.
You'll see a lot of code that seems unnecessary and it's because I first implemented GI & AO, then removed the GI part and am leaving the code ready for implementation of global illumination.