It is currently Sat Aug 22, 2020 4:53 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Modifying large quantities of voxels
PostPosted: Fri Jul 24, 2015 11:25 am 

Joined: Fri Jul 24, 2015 10:56 am
Posts: 2
Hi !

I'm currently working on a project whose goal is to model a human being in real-time with voxels.

The main difficulty is to keep a constant fluidity : it must run at 60 fps.
The size of the region is variable and up to 128 vox^3.

The cubiquity engine runs super smoothly once the voxels are loaded, but I can't manage to quickly modify the model : the only mean I see is to use the SetVoxel method. According to my tests, it takes approx. 200 ms to modify a 64^3 environment, and 1.6 seconds for a 128^3 one (to achieve the 60 fps thing, it must not take more than 16 ms :x )

I saw the C# code uses a C++ DLL, and I know how to use one (I created and used one myself before discovering Cubiquity), but I can't find the C++ code, nor method documentation.
Is it available, and do you know of a way I can modify the voxel data efficiently with a large range ?

Thank you for reading, I'm available if you need any more info on what I did or tested. :mrgreen:

EDIT: By activating the '-unsafe' option of Cubiquity, the time taken was divided by two :
We are now at 88 ms for a 64^3 generation and 500ms for a 128^3 one :)
We need to go deeper ! :geek:


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Modifying large quantities of voxels
PostPosted: Fri Jul 24, 2015 9:24 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
So you want to modify every voxel every frame? To be honest Cubiquity is not designed for this scenario so you will struggle to get the performance you want. Cubiquity works by generating a mesh from the volume data and assuming that any changes are likely to affect only a small part of this mesh (which works well for explosions, digging, etc), so that most of the mesh data can be reused between successive frames. Generating the mesh and then throwing the whole away one frame later does not seem like an optimal solution.

If I were faced with this requirement I would probably upload the volume data to the GPU each frame and then render it with direct volume rendering approaches (e.g. raycasting) rather than by surface extraction. For example, see:

http://graphicsrunner.blogspot.co.uk/20 ... g-101.html
https://github.com/brianasu/unity-ray-m ... c-textures

I think you might also find something on the asset store.

As for Cubiquity, the performance can indeed be improved but not really by you. The C++ code is not currently available and we don't have a stable API yet so it isn't documented. There is a lot which we can do internally (it currently runs all on one thread!) but you just have to wait for that.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Modifying large quantities of voxels
PostPosted: Mon Jul 27, 2015 7:00 am 

Joined: Fri Jul 24, 2015 10:56 am
Posts: 2
Arf, okay. Thank you for the answer, and for the links.
I guess we'll not use Cubiquity this time, though I'll keep it in mind for future games :p

Thank you and keep up the good work !


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net