TitleImage

Objective 12:
Voxel-Polygon Sub-Mesh Optimization

 

As described in an earlier section, after initially testing my spatial subdivisions, it was pretty clear that I needed to do a major overhaul of the Primitive structure to associate triangles with Voxels, not just the mesh objects that contained them.

This was a big job but after a couple of days, it paid off enormously. Initially, I had to guess a Voxel size for mesh-only scenes rather than choosing it optimally. The mesh was added to most of the available voxels, and rays were always checked against every triangle in the mesh! Of course this problem made my spatial subdivision code hardly useful at all for high-poly count mesh objects. In fact in many cases for Mesh-only scenes, my Uniform Spatial Subdivisions acted worse than the Naive method! Since I wanted to model a bunch of high-poly count objects in Maya and then import them into my Raytracer, I really required this functionality.

My testing with the Venus De Milo mesh object led to a large re-design of the underlying code so that Primitives (as opposed to GeometryNodes) could be stored in Voxels, thereby breaking a large mesh object into it's individual polygonal components and exponentially reducing render times for high-poly count mesh objects.

Accumulated Optimization Status Runtime
Initial Voxel Traversal with voxel size "guess" 12x12x12s 2752 seconds. (~46 minutes)
Voxel-Polygon Sub-Mesh Optimization 143 seconds (~2 and a half minutes)

 

Written by: Mike Jutan
CS 488 - Computer Graphics
University of Waterloo