It is currently Thu Dec 12, 2019 1:59 pm


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Mesh created by Paged Volume is bugged
PostPosted: Sun Sep 25, 2016 6:17 pm 

Joined: Fri Sep 23, 2016 3:03 pm
Posts: 5
Hey, so this time the problem is probably not caused by me since I encounter a similar problem in the PagingExample. In my UE4 project, I get weird extra planes when my region bigger than a certain amount. In the example I get weird artifacts for every size (I've only changed extractCubicSurface to extractMarchingCubesSurface, but it happens for both methods apparently).


Image
Image


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mesh created by Paged Volume is bugged
PostPosted: Tue Sep 27, 2016 7:05 pm 

Joined: Fri Sep 23, 2016 3:03 pm
Posts: 5
Looks like it's some uint8 causing the problem since it only happens once you go over 256 in the region size.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mesh created by Paged Volume is bugged
PostPosted: Tue Sep 27, 2016 9:32 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
BitteWenden wrote:
Looks like it's some uint8 causing the problem since it only happens once you go over 256 in the region size.


Yes, indeed, the CubicVertex is defined as follows:

Code:
/// A specialised vertex format which encodes the data from the Marching Cubes algorithm in a very
/// compact way. You will probably want to use the decodeVertex() function to turn it into a regular
/// Vertex for rendering, but advanced users can also decode it on the GPU (see PolyVox examples).
template<typename _DataType>
struct  MarchingCubesVertex
{      
   typedef _DataType DataType;

   /// Each component of the position is stored using 8.8 fixed-point encoding.
   Vector3DUint16 encodedPosition;

   /// The normal is encoded as a 16-bit unsigned integer using the 'oct16'
   /// encoding described here: http://jcgt.org/published/0003/02/01/
   uint16_t encodedNormal;

   /// The interpolated voxel data from the neighbouring voxels which generated this
   /// vertex (every vertex is placed between two voxels by the MArching Cubes algorithm)
   DataType data;
};


The '8.8 fixed-point encoding' limits the extracted size to 256. In practice users are expected to extract regions with a side length of 16, 32, or 64 (depending on your application) and extract multiple adjacent regions per volume which are rendered as separate meshes. This keeps each extraction fast, and means that you can quickly update the mesh for parts of the volume which change.

Edit: I though you were talking about cubic voxels to start with - with Marching Cubes you have to take a bit more care to line the meshes up. You might want sides lengths of 17/33/65 so that they actually touch.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mesh created by Paged Volume is bugged
PostPosted: Wed Sep 28, 2016 4:10 pm 

Joined: Fri Sep 23, 2016 3:03 pm
Posts: 5
Ah, alright. Thanks!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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