It is currently Sat Aug 22, 2020 3:40 pm


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Ignore certain kind of materials during mesh generation
PostPosted: Wed Sep 07, 2011 7:33 pm 

Joined: Wed Sep 07, 2011 6:53 pm
Posts: 8
I'd like to use PolyVox to store all my voxels, although not every one of them has to be processed by marching cubes.

So, first question:
Is it possible to ignore certain kinds of materials during mesh generation?

And one more:
It would be useful to have possibility for:
a) registering callbacks onMaterialMeshExtract, called for every voxel with given material
b) or just listing voxels from volume *by material*

So:
a) if i missed any of these features, could you tell me about it?
b) if you think any of these features should be in polyvox, are you planning to make it?
c) otherwise, do You have any propositions or advices for me how to implement them?

Thanks


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Wed Sep 07, 2011 9:47 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
shd wrote:
I'd like to use PolyVox to store all my voxels, although not every one of them has to be processed by marching cubes.

So, first question:
Is it possible to ignore certain kinds of materials during mesh generation?


No, that's not currently possible. However, you could take the generated mesh, iterate over the triangles, and delete those which have a vertex with the material you don't want. Maybe that's good enough for you? What are you trying to achieve?


shd wrote:
It would be useful to have possibility for:
a) registering callbacks onMaterialMeshExtract, called for every voxel with given material


There isn't this functioanlity. I have thought in the past it might be useful to have a new surface extractor which, instead of actually generating a mesh, would just generate a list of voxels lying on the border between solid and empty space. For example, you could then take that list of voxels and render a user-supplied model at each point instead of a cube. I haven't really looked at this any further though.

shd wrote:
b) or just listing voxels from volume *by material*


I guess you can find this information yourself, just by iterating over the volume, looking at each voxel, and keeping track of what you find?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Thu Sep 08, 2011 8:58 am 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
The way I do that currently is by copying the part I want to extract manually and erasing any voxels that I do not want.
I have not done any performance tests on this, but since I'm copying that part of the volume to a completely different thread for extraction anyway, this shouldn't have too much of an impact.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Thu Sep 08, 2011 10:19 am 

Joined: Wed Sep 07, 2011 6:53 pm
Posts: 8
David Williams wrote:
shd wrote:
b) or just listing voxels from volume *by material*


I guess you can find this information yourself, just by iterating over the volume, looking at each voxel, and keeping track of what you find?


I'm not sure you understood what i ment. I've been talking about some kind of separate structures for by-material enlistment. Whether it would be performance worthy, I'm not sure - just a guess.

So, thank You both for answers. Looks like i'll remove materials of choice before each decimation.

My idea isn't really original in replacing some voxels with complete meshes, or put them to l-system based generator.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Thu Sep 08, 2011 8:49 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
shd wrote:
I've been talking about some kind of separate structures for by-material enlistment.


I'm still not quite clear what you mean here. Rather than storing all the voxels in a single volume, you'd like a structure where the different material voxels are stored seperatly? Or you mean that after running the surface extractor you would like several different meshes - one corresponding to each material?

However, as mentioned here, it will be a little while before I can give you further information.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Fri Sep 09, 2011 12:16 am 

Joined: Wed Feb 16, 2011 4:15 am
Posts: 1
David Williams wrote:
shd wrote:
It would be useful to have possibility for:
a) registering callbacks onMaterialMeshExtract, called for every voxel with given material


There isn't this functioanlity. I have thought in the past it might be useful to have a new surface extractor which, instead of actually generating a mesh, would just generate a list of voxels lying on the border between solid and empty space. For example, you could then take that list of voxels and render a user-supplied model at each point instead of a cube. I haven't really looked at this any further though.


This would be very helpful. Just had to break my silence to let you know. Also, I'll take this opportunity to thank you for PolyVox.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Ignore certain kind of materials during mesh generation
PostPosted: Sun Sep 18, 2011 11:43 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
thalandor wrote:
This would be very helpful. Just had to break my silence to let you know. Also, I'll take this opportunity to thank you for PolyVox.

It should be straight forward to implement - I've added it to the short term todo list.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


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