GPWiki.org
GPWiki.org
It is currently Wed Jun 19, 2013 9:19 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jul 31, 2012 6:13 pm 
Shake'n'Baker

Joined: Sun May 27, 2012 6:01 pm
Posts: 62
Hi all,

Thought id start a small thread; Tell us something you learnt recently that you found interesting. Games Programming, General Computing/Programming or other all welcome!

Mikey


Top
 Profile  
 
PostPosted: Tue Jul 31, 2012 6:45 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
I've been doing some research on voxel engines and rendering (http://wzl.vg/bbs/viewtopic.php?f=1&t=12409), and i find it quite astounding how the amount of data piles up so quickly. I never had to think about managing memory efficiently, because a mesh and a texture doesn't cost that much.

When you go voxels though, every voxel (whatever its size) needs to be stored and usually, when you do voxels, the world you want to create is rather big than small.

Just think of a chunk of 32x32x32, which is would only describe a fairly small part of the world; thats 32768 voxels. Each voxel will probably have a color value and a type id for logics (at the bare minimum) so thats color (3floats for rgb) and 1 int for the type totalling in 16byte, times 32768 is half a megabyte for only a tiny fraction of what would describe a world. And this doesn't include the actual mesh data if you are using a vertex based renderer. I realized that you run out of memory fairly quick, and as of yet i havent found a way around it aside from compressing colors to palette lookups or decreasing its accuracy, which would get me down to 8 bytes per voxel, but that is still not feasable in large scale environments.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Tue Jul 31, 2012 7:56 pm 
Shake'n'Baker

Joined: Sun May 27, 2012 6:01 pm
Posts: 62
weezl wrote:
I've been doing some research on voxel engines and rendering (http://wzl.vg/bbs/viewtopic.php?f=1&t=12409), and i find it quite astounding how the amount of data piles up so quickly. I never had to think about managing memory efficiently, because a mesh and a texture doesn't cost that much.

When you go voxels though, every voxel (whatever its size) needs to be stored and usually, when you do voxels, the world you want to create is rather big than small.

Just think of a chunk of 32x32x32, which is would only describe a fairly small part of the world; thats 32768 voxels. Each voxel will probably have a color value and a type id for logics (at the bare minimum) so thats color (3floats for rgb) and 1 int for the type totalling in 16byte, times 32768 is half a megabyte for only a tiny fraction of what would describe a world. And this doesn't include the actual mesh data if you are using a vertex based renderer. I realized that you run out of memory fairly quick, and as of yet i havent found a way around it aside from compressing colors to palette lookups or decreasing its accuracy, which would get me down to 8 bytes per voxel, but that is still not feasable in large scale environments.


I like the computed vs stored data that youve reminded me of (3d model vs voxel, svg vs pixel, midi vs wav). And that both need to take into account the data and its usage.

Check out Sparse Voxel Octrees, which removes 'transparent' voxels.

imo i dont think voxels will catch on for the simple reason that its pretty rare to need to look at the data that hides below the surface. But who knows.


Top
 Profile  
 
PostPosted: Tue Jul 31, 2012 8:26 pm 
Why store the color on each voxel? Aren't they being textured based on a material (like Minecraft)?

Also, you can use run length encoding on the blocks to reduce size. You only need to read it when they change, otherwise you only need the vertices in memory. Or you can store mostly empty chunks as a Dictionary keyed by XYZ instead of an Array. There are lots of tricks available for saving memory.


Top
  
 
PostPosted: Tue Jul 31, 2012 9:09 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
cxzuk wrote:
Check out Sparse Voxel Octrees, which removes 'transparent' voxels.


Yeah thats on my list. I didn't look into it yet but i might need to if i want to pursue this experiment.

Guest wrote:
Why store the color on each voxel? Aren't they being textured based on a material (like Minecraft)?


You certainly can texture them, but many would argue that those will not be voxels anymore. I couldn't care less personally, but i try to achieve a certain look that is not possible to achieve with using textures.

The reason minecraft does it is mostly due to the fact that its voxel resolution is pretty damn low, so it's the only way to get some detail into the world.


Guest wrote:
Also, you can use run length encoding on the blocks to reduce size. You only need to read it when they change, otherwise you only need the vertices in memory. Or you can store mostly empty chunks as a Dictionary keyed by XYZ instead of an Array. There are lots of tricks available for saving memory.


Yeah there are ways to decrease the total amount of data necessary at a time regarding occlusion, empty chunks etc. But storing the vertex data only in video memory requires a complete reconstruction of the whole chunk if just one voxel changes. It's a trade off between performance and memory.

cxzuk wrote:
imo i dont think voxels will catch on for the simple reason that its pretty rare to need to look at the data that hides below the surface. But who knows.


Yeah, using voxel environments makes most sense if you require dynamic changes to it.
If you have static geometry you could only store the surfacing voxels, using an octree would save a bunch of data that way i assume.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group