Domanda

Since I don't want to reinvent the wheel I'm searching for a good data structure that can help me with a really basic 3D editor for a 3D render engine, I'm basically looking for a data structure that is able to store the necessary data which in my case is limited to :

  • geometry
  • local and global coordinates or also called transformations
  • materials or pointers to another structure holding the real definition for this materials

Now this is my first approach with a 3D rendering but I have a good foundation about how a rasterizer works, how triangles, points and lines are handled by the GPU to produce an image, My problem is that now I don't get what this new "voxel based" data structure is and even if this OpenVDB is the right structure for me or not.

I think that most of the "inputs" for this engine will be from obj-like files, so triangles and points basically, but I still don't wanna miss the latest and greatest, so I ask, what's a real difference between OpenVDB and a generic data structure that holds a triangulated mesh ? What are the possible real world applications for OpenVDB ?

È stato utile?

Soluzione

If you understand the difference between vector and raster art in 2D, that is analogous to the difference between triangles and voxels. Vector art uses line segments and geometry to represent shapes, just as triangles represent meshes in 3D. Alternatively, an image uses pixels arranged on a grid to represent shapes, just as voxels are used to represent 3D volumes.. For example, a sphere may be represented as a mesh, with triangles.. or as a set of on/off voxels on a 3D grid.. 3D textures can now be stored on the GPU, allowing efficient raycasting, traversal, etc. They are especially useful for smoke and fluids.

OpenVDB is CPU-based, but extends a single 3D volume so that it is multi-resolution. Many smaller NxNxN volumes are combined into a tree to make a much, much larger volume.

What representation you use depends very much on the kind of 3D editing operations you want to do. Do you want to build trees and organics? Do you want to edit and model fluids? Do you want to model characters?.. For a really basic, i.e. intro 3D editor, I would suggest triangles and meshes as these are ubiquitous, and how GPU pipelines are designed.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top