armory3d / armory

3D Engine with Blender Integration
https://armory3d.org/engine
zlib License
3.08k stars 319 forks source link

AO clipmaps #2992

Closed e2002e closed 10 months ago

e2002e commented 10 months ago

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.