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


All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Mon Jan 17, 2011 8:32 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
Yeah its using 2^3 32x32x32 volumes in those screenshots. I'll try the single volume with a sphere out in a sec. The reason I want to use multiple volumes is because I'm going to be using this for a MMO type thing with more terrain data than can fit in server or client memory at once, so I wanted to page them to and from disk on the server. Maybe the paging should be done inside polyvox, instead. Hmm :?

edit: seems fine with a sphere overfilling the volume
Image
but with the continuous noise it does this
Image


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Mon Jan 17, 2011 10:23 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
ape wrote:
Maybe the paging should be done inside polyvox, instead. Hmm :?

I think it should. Improving the volume compression is probably my highest priority task for PolyVox and I will do some work on it in the next couple of months. I'm not currently planning paging though - just much better compression (I would estimate a factor of 100 over the raw uncompressed data). But I think you'll need to worry about rendering performance before memory issues.

ape wrote:
edit: seems fine with a sphere overfilling the volume ... but with the continuous noise it does this

What's causing the problem, is it the fact that there are multiple volumes, or the fact you are using the perlin noise? If you create a single volume of Perlin noise then is it correctly 'sealed'?

Edit: Assuming it's the multiple volumes, are you creating a seperate SurfaceExtractor for each? If not maybe try that in case it's not being reset between volumes or something?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Mon Jan 17, 2011 10:33 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
Yeah, I'm using a separate extractor for each volume. The problem occurs even with just one volume, I think. I'll test it in a second to make sure.

edit: you seem to be on to something with that, it doesn't get holes with just 1 mesh but when i up it to 8 cells it does. Hmm.

http://dl.dropbox.com/u/6281166/bug.jpg
http://dl.dropbox.com/u/6281166/nobug.jpg


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Mon Jan 17, 2011 11:34 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, some random thoughts which might shed some light...

Does it only happen on one face (I can't see the back in the screenshot)? If so which one? I'm guessing it's along positive or negative Z?

Can you simplyfy it to two volumes and still get the problem? Does matter how they are placed (next to each other, above/below, etc)?

Does it happen on both of them? Or is it just the first or second?

Can it be a rendering problem? Assuming all the volumes have the same data, can you print out the number of vertices/indices to see if it's the same between volumes?

That's more questions than answers I'm afraid but it's some things to look for...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Mon Jan 17, 2011 11:44 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
Yeah it's only on the one face, not sure what axis it is atm. The holes in each mesh seem to be totally independent of what I set the volume data to. Even when its 100% full it still gets those same holes in the same volume's mesh. The holes and which volumes get them don't change at all when I rerun the program. This seems a lot like some kind of memory corruption. It repeats across most volumes but some don't have any problem.

http://dl.dropbox.com/u/6281166/bug2.jpg


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Tue Jan 18, 2011 12:19 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, it seems it would be worth me trying to reproduce this. I'd rather leave out rendering, so maybe you can create a C# snippet which creates a volume, fills it (solid is fine as that seems simplest), extracts a mesh, prints the numbers of verts/indices, and then does that again? Then I can convert that code to C++ to see if I can get the same thing to occur.

I'll look at it tomorrow if I can, otherwise the next day.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Tue Jan 18, 2011 12:45 am 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
I just compared and all the vertex and index counts match. I even tried feeding the renderer the first mesh 8 times and it changes. The errors are changing each time now so it definitely seems like memory corruption of the vertices/indices from something, hmm.

Now I'm testing it again and the vertices are equal, but they still render differently... this doesn't make any sense at all :(
I have a hunch that its the nuclex batch renderer screwing everything up, again. Going to try doing the vertex/index buffer rendering myself.

edit:
I was right, its the goddamn nuclex batch renderer screwing it up. Going to give the nuclex coders my regards about it later :P Sorry to have wasted your time with 2 stupid nuclex bugs in one day, haha.
Image


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Tue Jan 18, 2011 5:58 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
ape wrote:
I was right, its the goddamn nuclex batch renderer screwing it up. Going to give the nuclex coders my regards about it later :P Sorry to have wasted your time with 2 stupid nuclex bugs in one day, haha.

No problem, glad you got it working.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Tue Jan 18, 2011 6:02 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
Yeah, now I just need to fix the seam normals. I guess I will do what the other guy did and copy in border info from neighboring cells so it lines up properly.
http://dl.dropbox.com/u/6281166/lighting.jpg
http://dl.dropbox.com/u/6281166/weareborg.jpg
http://dl.dropbox.com/u/6281166/exploded2.jpg


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Seamlessly aligning extracted meshes
PostPosted: Fri Jan 21, 2011 11:25 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
I'm still investigating possible ways to get rid of the seams for non-cubic cells. Apparently the C4 engine calculates each cell mesh at 3 different voxel resolutions and stitches cells together, selecting the detail level based on camera distance. I'm not sure how they avoid having to regenerate the whole mesh every time a single cell is changed, though. Anyone have any theories on how it might work?. I think they might be using a vertex shader to do it in real time but I don't know how to even begin doing something like that. I think actually generating new vertices in the shader requires directx 10 so it might only be possible to do on the cpu.
http://www.terathon.com/wiki/index.php? ... ng_Terrain

edit: Aha, found the paper on what C4 uses http://www.terathon.com/lengyel/Lengyel ... in-Low.pdf
What do you think the chances of something like this being implemented in Polyvox are, David? I know you said you weren't going to focus on supporting very large worlds, but I think it would make the library much more useful.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2, 3  Next

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