Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
Problem with normals at edges of marching cubes mesh http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=494 |
Page 1 of 1 |
Author: | deltaflux [ Tue Mar 26, 2013 8:46 am ] |
Post subject: | Problem with normals at edges of marching cubes mesh |
Hi, I'm trying to generate a large landscape, but split it into chunks for rendering so I can have an unlimited landscape size. The problem I have is that when generating a mesh using the MarchingCubesSurfaceExtractor, the normals for the vertices at the edge of each chunk are incorrect. For each chunk, I populate a SimpleVolume with values generated using a noise function, so I think the problem is that the surface generator doesn't have access to data outside the chunk and therefore can't produce the correct normal. Actually, I've just spotted that I could generate a SimpleVolume which is slightly larger than the volume I want to generate, and then pass a slightly smaller volume to the MarchingCubesSurfaceExtractor, so I get neat edges. I'll leave this question here in case I'm wrong - if I'm right I'll post back with screenshots ![]() |
Author: | David Williams [ Tue Mar 26, 2013 9:54 am ] |
Post subject: | Re: Problem with normals at edges of marching cubes mesh |
Hi, actually this is a common problem - have a read of this entry in the documentation: http://www.volumesoffun.com/polyvox/doc ... aller-ones Also, if you choose to continue with your current approach of using multiple SimpleVolumes then you might want to grab the version of PolyVox from Git Develop branch as this has support for setting the wrap mode for when you sample outside a volume. Setting this to 'clamp' might help in your case. |
Author: | deltaflux [ Tue Mar 26, 2013 1:52 pm ] | ||
Post subject: | Re: Problem with normals at edges of marching cubes mesh | ||
Awesome, I switched my implementation over to using a LargeVolume and the seams are gone. Thanks for the documentation link, I'd actually already glanced over the docs and missed that - I'd been focussing on the page about lighting and normal. Anyway, as promised here's a screenshot. I'm using Cinder as the rendering library which I'm really enjoying. I'll try to post some more information as I go along - I'm very impressed with Polyvox, I'd started cobbling together my own voxel engine before I found it so I appreciate how much time it's saved me ![]()
|
Author: | David Williams [ Tue Mar 26, 2013 8:09 pm ] |
Post subject: | Re: Problem with normals at edges of marching cubes mesh |
Looking good! That's a nice texture, and do you have some kind of AO/shadowing going on (the hole in the centre looks dark)? |
Author: | deltaflux [ Tue Mar 26, 2013 9:16 pm ] |
Post subject: | Re: Problem with normals at edges of marching cubes mesh |
I've just got a point light attached to the camera in that shot ![]() |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |