It is currently Fri Nov 15, 2019 8:05 am


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Fri Aug 01, 2014 5:55 pm 

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
Hi.

I've noticed that there's this MeshDecimator that I'd like to use with CubicSurfaceExtractorWithNormals (actually, it's a modified version to allow different kinds of blocks ). However, it is said that it won't work with it. Could somebody elaborate why? Maybe it's not that hard to fix.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Fri Aug 01, 2014 11:28 pm 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
Use the cubis mesher without normals and just calculate them into your shader. :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Sat Aug 02, 2014 8:58 am 

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
Quote:
that I'd like to use with CubicSurfaceExtractorWithNormals (actually, it's a modified version to allow different kinds of blocks )


I'd have to first rewrite my custom extractor to work with CubicSurfaceExtractor, and I'm not sure that'd be too easy, since I have slope surfaces, too.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Mon Aug 04, 2014 9:04 am 

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
Okay, after I remove duplicate faces and make sure using cross product on faces gives a correct normal, I get a messed-up mesh. (I'm trying to build a 4x4x4 cube)

It's shape is right, there's less vertices and triangles, but it's basically very messed up. (It doesn't have the expected two triangles per face)

Any ideas what could that be?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Mon Aug 04, 2014 11:39 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hi, sorry for the slow reply.

In general I would not expect the MeshDecimator to behave correctly in this scenario, and actually both the CubicSurfaceExtractorWithNormals and MeshDecimator are removed from the development version of PolyVox. Instead we expect users to compute normals in their shader (actually we may provide some kind of normal in the future but this is still under consideration) and to use the built-in decimation of the 'extractCubicMesh()' function (which replaces the CubicSurfaceExtractor class).

Note that you can still use shader-generated normals if you have slopes, etc, the only limitation would be that you have flat-shading rather than smooth-shading.

The MeshDecimator was designed for the Marching Cubes meshes so I'm pretty sure it won't work properly for the cubic ones (or perhaps others). Perhaps you could try a dedicated mesh processing library such as OpenMesh(I haven't used it myself)?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Mon Aug 04, 2014 3:44 pm 

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
I did try to use OpenMesh, but stumbled upon lack of tutorials / up to date documentation (?). Couldn't really find out how to do what I wanted. I guess I might try once again if you say MeshDecimator won't work, though. I hope I can get it to work the way I need :?

Anyways, thanks for the reply. :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Wed Mar 16, 2016 12:00 pm 

Joined: Thu Feb 11, 2016 6:11 pm
Posts: 1
Hello,

For who is interested in mesh decimator / simplification
there is some good lib arround, take a look at :

GTS stands for the GNU Triangulated Surface Library :
http://gts.sourceforge.net/

Polyshop (Easy Mesh Simplification) :
http://www.melax.com/polychop

Or a more *simple* mesh "simplifier" :
https://github.com/sp4cerat/Fast-Quadri ... lification

Or use g**gle a bit, there is alot of result with "mesh simplification" ;)

Edit:
i forgot to say, there is some algo to test and easy to use :
https://www.giawa.com/journal-entry-6-g ... imization/
http://0fps.net/2012/06/30/meshing-in-a-minecraft-game/

Best regards,
Naskel


Top
Offline Profile  
Reply with quote  
 Post subject: Re: MeshDecimator and CubicSurfaceExtractorWithNormals
PostPosted: Thu Mar 17, 2016 9:08 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Naskel wrote:
For who is interested in mesh decimator / simplification
there is some good lib arround, take a look at :

...

Yes, these are some good links, thanks.

Naskel wrote:
i forgot to say, there is some algo to test and easy to use :
https://www.giawa.com/journal-entry-6-g ... imization/
http://0fps.net/2012/06/30/meshing-in-a-minecraft-game/

Best regards,
Naskel

Actually PolyVox already implements greedy meshing for cubic (Minecraft-style) meshes. It is only the smooth Marching Cubes meshes which need an external library for simplification.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 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