Jump to content


Question about voxels and polygons


11 replies to this topic

#1 redgamerman

    New Member

  • Members
  • Pip
  • 1 posts

Posted 29 March 2012 - 07:06 PM

Hey there devmaster forums,

I'm really interested in voxel theory. I've seen a couple of topics on this forum that have talked about it some. I also know that some big engine out there (was it the one that powers Crysis?) uses them some for terrain generation or something. I looked voxels up on wikipedia as well and read something about polygons being used in conjunction sometimes with them. How are polygons and and voxels used together? And why aren't they used more often in modern games? Thanks.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5340 posts
  • LocationSanta Clara, CA

Posted 29 March 2012 - 07:13 PM

I'm not aware of any of the big engines using voxels for terrain - you might be thinking of heightfields, which is a different thing?

There's basically two ways of rendering a voxel object: either convert it into polygons (using an algorithm like marching cubes) and render the polygons, or render it directly by raytracing.

Both of these are pretty slow processes, which I think is the main reason why voxels aren't used more in full-fledged games (vs tech demos and suchlike). The most recent generation of GPUs have some nice features that allow much faster voxel processing than before, but it's still not fast enough for full-fledged games, except in some special cases. Some games use voxel-based fluid sims. The LittleBigPlanet games made fairly extensive use of voxels, but they're helped out by their game world being 2.5D - very thin along the depth axis - so they can get away with something that's only 16 voxels deep, which helps keep the costs down.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Stainless

    Member

  • Members
  • PipPipPipPip
  • 610 posts
  • LocationSouthampton

Posted 30 March 2012 - 08:42 AM

There is a guy called Branislav Siles who is working on a cross platform voxel system that is more than good enough for AAA games.

I have been trying to get more details from him for ages, but the videos are awesome. Much nicer than unreal for a start.

The basic technique I have got out of him is he uses a very efficient sparse 3d array to store mipmaps of voxel objects.

So if you are a long way away from an object it is displayed as a quad, get a bit closer and it's displayed as a few quads , ad nauseum

The voxels are displayed as billboards, so each one is very quick to render.

The clever bit, is the storage of the voxels and the way he parses it in the game. He's not talking about that.

There are other demos of efficient sparse 3d array rendering on gpu's which are just beautiful.

I disagree with Reedbeta on this one, voxels are the way forward, just not voxels as we used to think of them. :rolleyes:

You could also research things like "voxel polygons" which is a nice way of getting around a few of the issues with voxels.

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5340 posts
  • LocationSanta Clara, CA

Posted 30 March 2012 - 04:59 PM

I should clarify that when I said they're not fast enough for games, I mean they're not fast enough right now. They may well be the way forward, if the problems with them can be solved. :)

Stainless, I looked at some of the screens and videos on that guy's site, and have seen various other sparse voxel demos before, and they do look really good. However: (1) most of the test worlds look very small, no more than a few meters big; (2) probably the entire capacity of the CPU/GPU is being used to render these things, leaving nothing for all the other stuff a real game has to do, and (3) there's little or no animation of the voxel stuff. I did see some videos of a truck driving around and leaving tire tracks, but the truck is polygonal and tire tracks could very well be done with some special-case tricks; it's a far cry from the amount of animation you would need to do a proper game with extensive breakable objects, trees swaying in the wind, etc.

I don't know how the voxels are stored and rendered in these kinds of demos, but you can often tell more from what's left out than what they put in.
reedbeta.com - developer blog, OpenGL demos, and other projects

#5 Stainless

    Member

  • Members
  • PipPipPipPip
  • 610 posts
  • LocationSouthampton

Posted 31 March 2012 - 06:19 PM

I've been talking to him about us porting his engine to our platform, we gave him a developer account, but our software requires a professional version of visual studio, he doesn't have one.

From the conversations I have had with him, he's solved all the issues you mention. Which is why I am so keen to have a proper look at it.

We will wait and see what he comes up with, I hope he's right.

#6 Reedbeta

    DevMaster Staff

  • Administrators
  • 5340 posts
  • LocationSanta Clara, CA

Posted 31 March 2012 - 07:37 PM

I'll believe it when I see it. :) A few of these voxel engines have popped up over the last few years, usually with overly grandiose claims about how their engine is going to change the landscape of the games industry, but they all have the same issues (particularly the extremely limited animation capabilities), the developers are always extremely secretive about their techniques, and none of these engines have ended up going anywhere but the bit-bucket. :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#7 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 31 March 2012 - 07:46 PM

View PostStainless, on 30 March 2012 - 08:42 AM, said:

I have been trying to get more details from him for ages, but the videos are awesome.

I don't suppose you have a link?

#8 Stainless

    Member

  • Members
  • PipPipPipPip
  • 610 posts
  • LocationSouthampton

Posted 31 March 2012 - 07:50 PM

he's working on a demo he is going to release as a binary, I don't have any links for anything he has done anymore.

#9 Reedbeta

    DevMaster Staff

  • Administrators
  • 5340 posts
  • LocationSanta Clara, CA

Posted 31 March 2012 - 08:08 PM

I just googled his name and came up with this: http://www.atomontage.com/
reedbeta.com - developer blog, OpenGL demos, and other projects

#10 elengyel

    Member

  • Members
  • PipPip
  • 50 posts

Posted 31 March 2012 - 08:58 PM

The C4 Engine has been using voxels for terrain generation for a few years now, and it's tools allow real-time modifications to a large 3D voxel field. Polygon meshes are generated with marching cubes and stored for later rendering. Level of detail is handled by generating meshes at different voxel resolutions and seamlessly connecting them with the transvoxel algorithm.

#11 Vilem Otte

    Valued Member

  • Members
  • PipPipPipPip
  • 362 posts

Posted 02 April 2012 - 12:43 AM

Voxels are good in some ways - especially for fluids, gases, clouds, etc. - they can make it look shiny. Thought honestly I don't think they will replace the almighty triangles ;)

Ad C4 and real-time modification of voxel terrain - just out of curiosity - any OpenCL involved in marching cubes, or are you actually doing it that fast on CPU? :)
My blog about game development (and not just game development) - http://gameprogramme...y.blogspot.com/

If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D

#12 elengyel

    Member

  • Members
  • PipPip
  • 50 posts

Posted 02 April 2012 - 04:49 AM

View PostVilem Otte, on 02 April 2012 - 12:43 AM, said:

Ad C4 and real-time modification of voxel terrain - just out of curiosity - any OpenCL involved in marching cubes, or are you actually doing it that fast on CPU? :)

It's all on the CPU.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users