The goal of this project is for a user to be able to edit, load, and save volume data.
The main issue is how to store the volume data.
A simple way to store a volume is extending a 2D texture to a 3D texture.
OpenGL has great support for 3D textures however, to have high levels of detail large resolutions are needed and texture sizes grow cubically so a 1024^3 texture is 1GB!
However, the user is only concerned with the interface between empty space and occupied space or the surfaces of the volume.
This still grows a rate of N^2 but is much better!
So, a simple optimization structure like an Octree or an N^3 tree can be used.
Much of the early work of this project was focused on creating this optimization structure and is documented in
this article.
Instead a different approach is used for this project.
Signed distance fields can be used to create CSG models.
A CSG model is nothing more than a series of solid operations like union, subtraction, and interstation.
To make the models more organic interesting operations like smooth unions and noise functions are used.
The only problem with this method is complex models could require thousands of operations for every intersection test!
So, to efficiently store the CSG model chunks are used.
Each chunk represents a cube of space and has a limited number of objects in it.
This then drastically reduces the number of objects to be tested.
These chunks could also be in an octree allowing for variable sized chunks for efficient ray casting.