Jump to content
  • Advertisement
Sign in to follow this  
sia

Mesh generation and geomipmaps from voxel datas

This topic is 4172 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I'm working on a voxel terrain. I'm just handling geometry generation for now. For now, the terrain consists in an octree where leafs are 8x8x8bits (64bytes) containing 1(full) or 0(empty). If an octree node is totaly filled or totaly empty, I don't store its leafs. For mesh generation, I go down the octree and generate a Lego-look mesh for each 8x8x8 leaf. And the trouble comes here: I have to smooth each leaf/mesh in order to have a more 'normal' terrain. But I can't/don't know how to get neighbours mesh joint vertex. That gives me cracks and bad normals. The problem is the same for LOD. I want to make LODed mesh (geomipmaps) but without the link between vertices of the mesh, I can't achieve it. That problem is easy to solve when having heightmaps where each mesh has the same number of vertices, positioned periodicaly. Better with a (ugly) screen shot : http://www.azoted.com/terrainbadborders.jpg Did anyone succeeded using that method? Any other solution for the mesh generation? Thanks for your help

Share this post


Link to post
Share on other sites
Advertisement
So how are you generating the meshes? Marching cubes? I use marching cubes in my project and don't suffer from cracks - but I agree the normals are problematic and I haven't solved this yet...

Share this post


Link to post
Share on other sites
I started with marching cube. But generation is slower with it and normals aren't computed.
The principle of my 'lego' is simple. For every volume bit, I look at his 3 neighbours bit (up, right, front). If the current volume bit is different than its neighbours bit, I create a quad. The direction (CW or CCW) of that quad is determined by the current bit(1 or 0). So with that, for each bit volume, I create up to 3 quads. As the quads are aligned to an axis, each vertex using that quad have that axis for normal.
The normals are smoothed just like the vertices are.

Share this post


Link to post
Share on other sites
Quote:
Original post by sia
I started with marching cube. But generation is slower with it and normals aren't computed.


It's really not slow, in the past I've applied it to a 256x256x256 volume several time per second. And you can calculate the normals yourself, though I agree it's alittle bit tricky to get smooth shading. Have a look at my project here:

http://www.ogre3d.org/phpBB2/viewtopic.php?t=27394

The screenshots don't show smooth shading but it's in the latest (unreleased) version.

Quote:
Original post by sia
The principle of my 'lego' is simple. For every volume bit, I look at his 3 neighbours bit (up, right, front).


Do you use all three directions even if you are on the on the edge of a leaf or not? The is, it you are processing a leaf's edge voxel, do you 'peek' into the next leaf?

Share this post


Link to post
Share on other sites
Yes, I get neighbours leafs.
Your screenshots are nice.
marching cubes are good for hi frequency voxel like in your shots.
I want to use voxel for terrains like in Crysis ;) lower frequency, more need for LODs.

Share this post


Link to post
Share on other sites
Well I don't really know the answer to your problem, but I have a couple of interesting links for you...

http://www.ogre3d.org/phpBB2/viewtopic.php?t=30491

http://www.gamedev.net/community/forums/topic.asp?topic_id=439081

Share this post


Link to post
Share on other sites
Quote:
Original post by sia
But I can't/don't know how to get neighbours mesh joint vertex. That gives me cracks and bad normals.
The problem is the same for LOD. I want to make LODed mesh (geomipmaps) but without the link between vertices of the mesh, I can't achieve it.
That problem is easy to solve when having heightmaps where each mesh has the same number of vertices, positioned periodicaly.


I believe you can start from this paper
Efficient Neighbor Finding Algorithms in Quadtree and Octree. It features an algorithm both for joints and edges (and even... faces) in octree.

Let me know if it works for you.

Share this post


Link to post
Share on other sites
"VISUALIZATION OF LARGE ISO-SURFACES", Demo & PDF.
www.xinix.org/sven/main/publications.htm

Paper only gives main ideas, you may ask the author for details.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!