Ambient occlusions optimizations
Hantverk'n » Devlog
I've managed to improve frame rates by over 25% in some scene views when ambient occlusion is on with some optimizations I implemented!
Without optimizations:
With optimizations:
Hantverk'n
Status | In development |
Author | Teknologicus |
Genre | Adventure |
Tags | Exploration, Open World, Voxel |
More posts
- Voxel-level ambient occlusion optimization bits generation via compute shader38 days ago
- Image rotation via shearing43 days ago
- Rotation without rotating44 days ago
- Voxel volume mipmaps generation via compute shader45 days ago
- Dynamic global illumination methods57 days ago
- More ambient occlusions optimizations84 days ago
- Procedurally generated grooved, cracked brick blocks87 days ago
- Procedurally generated cobblestone blocks with surface indentations87 days ago
- Procedurally generated mortar grooved brick blocks88 days ago
- Testing other colors of procedurally generated mushrooms91 days ago
Comments
Log in with itch.io to leave a comment.
Impressive. How did you do it?
There was an inefficiency in how the voxel-level ambient occlusion was fetching surrounding voxels via tetrahexacontree traversals to calculate ambient occlusion shading in the GLSL fragment shader for each ray voxel hit . It still traverses the tetrahexacontree to fetch the surrounding voxels, but caches the voxel volume index for each traversal following the first traversal to a given volume. So if all the surrounding voxels are within the same volume as the first traversal, only that one initial traversal is needed. If one or more of the surrounding voxels are in other volumes, it caches those volume indices as well to avoiding additional traversals.
The same inefficiency was in how the voxel-volume-level ambient occlusion fetched non-air voxel counts and was solved with the same voxel volume index caching mechanism.
In implementing this optimization, I realized the voxel-level ambient occlusion could also be sped up even more if I keep bits in each voxel indicating if a given voxel face (same x, y and/or z plane) and its surrounding face plane neighbors are air voxels. If the surrounding voxels for a given face are all air voxels, then the face doesn't need to be shaded by voxel-level ambient occlusion. I'm working on this and it should yield even greater performance gains than the voxel-level ambient occlusion optimizations described above yielded.
Well I don't know how your system is setup in the first place, but I generally get how you optimized it.