Hi!
DennyR wrote:
Basic question about units
As far as I can tell, the voxel volume and the extractors operate on integers. So when I extract a mesh, this mesh will be extracted around the integer voxel data, right? So if I want a bigger mesh, I'd have to manually scale it up, or is there some kind of unit system in place to scale the voxel volume itself?
Indeed, there are no units. You simply decide how big you want each voxel to be in your world and scale the mesh by the appropriate amount.
DennyR wrote:
More units and conversion
Basically an extension of the last question. Lets assume I would like to live edit my voxels with a sphere of a certain radius. The sphere lives in the games world coordinate space. Is there any functionality to transform the sphere and return all voxels within the sphere? Or do I have to write the transformation myself?
This is not built in, you would need to do the transformation yourself.It is certainly possible though, as demonstrated by this video (Cubiquity builds on PolyVox):
https://youtu.be/NLQozqoPMho?t=5m10sDennyR wrote:
chunks of a volume
I've already set everything up to work multithreaded with a pool of vertex buffers and extractor threads that would operate on regions of a RawVolume(possibly changing this to PagedVolume later). Is there any way to define a chunk size and then just operate mesh extractions on the chunks or blocks? For example having a 1024x1024x1024 volume that is subdivided into 32x32x32 blocks. I can't find any built in way of telling in what chunk a certain voxel lives in. My plan was to set it up in a way that every voxel knows in what chunk it lives and whenever a voxel gets editited it marks the chunk as dirty, so I can extract a new mesh using a worker thread.
Be aware that 'chunks' is a bit of a vague term which can have a couple of different meanings. Firstly, it can apply to the storage of data. PagedVolume stores it's voxels as a set of 'chunks' typically between 16^3 and 64^3. Such chunking is an implementation detail and not really exposed through the API. RawVolume does not store data as chunks but instead as a single large array. Use RawVolume to start with.
Secondly, regardless of whether the volume uses chunks, you can choose to only extract part of it (which does not have to line up with any internal chunk boundaries, if they even exist).
You can use integer division and modulus operations to get voxel chunk positions and offsets. E.g. for pos 47 with chunk size 32 you have 47 / 32 = 1 (chunk 1) and 47% 32 = 15 = voxel offset 15 into the chunk. However, be aware that surface extraction also requires looking at *neighbouring* voxels.
Expect pain when it comes to threading, unfortunately this is an area of PolyVox which never really got developed properly. I will try and give that more thought for Cubiquity 2.
http://www.volumesoffun.com/polyvox/doc ... ading.htmlDennyR wrote:
Not a real question, but
I am planning on making a voxel planet using marching cubes, any tips or possible culprits a naive, first time voxler could run into?
Scale is the biggest issue as I never worked with very large volumes, but just see how far you can push it. Again that is something I want to improve in future work.