NVIDIA / gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
Other
679 stars 145 forks source link

wrong topology computation in example g3DPrint #38

Closed drmateo closed 5 years ago

drmateo commented 5 years ago

I'm trying to use this project to implement some material simulations. But before to go ahead, I'd like to know if the output of the g3Dprint example is correct. Assuming that It is defined a GVDB configuration such that <3,3,3,3,5>, the number of visualized level should be 5, am I right?

If I'm right, it's means that some thing is not working on. So any clue to resolve this?

screenshot from 2018-11-16 15-18-01

ramakarl commented 5 years ago

If I remember correctly, GVDB only uses the number of levels needed to support a given volume. That is, this volume fits within 3 levels, so the top two levels are not used. You might want to confirm this by looking at how the topology overlay is drawn, e.g. drawTopology. In any case, for performance during raytracing of the actual volume, there is a "top_lev" variable that specifies the level of the root. It is used by the renderer to avoid traversing the higher unused levels.

drmateo commented 5 years ago

Thanks for your fast response. Yes, you'r right, there is a "top_lev"variable which specifies the level of the root in the renderer method. But, I've discover that the problem in my specific problem comes from the VolumeGVDB::SolidVoxelize member function. In this function, it is explicitly written the number of levels to create the topology (N=3).

I'm going to create a pull request uploading my correction. I've change N=3 by N = mPool->getNumLevels ();

ramakarl commented 5 years ago

Thanks!