I have created a simple scene in directx11 that has a plane as a floor, with several spheres, cubes and rectangular walls. There is only 3 objects loaded: a plane, cube and sphere; but the cube and sphere are instanced several times with different scaling, positions and rotations. Two of these objects are dynamic.
I would like to voxelize this entire scene (100x100x20 units) into 0.2 unit voxels, taking into account the object instances which have different scales and rotations.
I have read several articles on voxelization and have the source code from GPU Pro 3 of "Practical Binary Surface and Solid Voxelization with Direct3D 11"; but all of these articles show the voxelization of single objects - taking their triangles and splitting them into a grid.
How would I extend these methods to account for an entire scene with multiple object instances?
The only thing that I can think of is I would have to do a top-down octree division of the entire scene. But for a dynamic scene, would this be too expensive?
For my scene, I use a buffer for each model loaded, so if I were to voxelize in the Compute Shader, would I need to copy all three buffers to a single buffer? How do I account for model instances?
Thank you.