Page 1 of 2

Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 8:29 pm
by yamashi
So today I had an idea, I decided to become a competition to minecraft (yes I know...)
Well in 4 hours here is what I achieved (cosinus) :

Image

few hours later (Perlin noise with caves) :

Image

In this frame you have 16 x 16 x 128 x 18 x 18 cubes = 10.6 million cubes.
As you can see the frame rate is pretty decent !
It runs on a GTX 275.

Milestone :
- ?? Geometry Shaders ??
- Biome generation (1 day)
- Little guy to walk arround (2 hours)
- Ray casting and block placement / Destruction (1 day)

Then who knows ?!

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 8:41 pm
by _tommo_
Just try to add per-block lighting and textures and see where the framerate goes :D

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 8:56 pm
by yamashi
Remains at 120 fps :)

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 10:07 pm
by JamesKilton
As long as you don't turn into a gigantic asshole like the FortressCraft guy (his attitude is doing way more harm to his project than the fact that it's a minecraft clone...), there's nothing at all wrong with copying a design for your own project (ignoring patent / copyright issues of course). In terms of programmer art, it's really hard to get simpler than the blocky voxel-world of Minecraft and outside of that voxel worlds open up a lot of possibilities that is prohibitively hard in polygon worlds (namely, geometry creation / destruction).

You going to use geometry shaders to make it less blocky?

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 10:52 pm
by yamashi
I will be using GS to update chunks and compute visibility because right now the cooking of the mesh has to be asynchronous in order to get a decent frame rate...

EDIT : Added a screenshot with textures !

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 11:28 pm
by TechnoBulldog
Wow, that looks pretty cool. Somehow I didn't expect OGRE to render that many cubes without a significant loss in FPS. That's pretty awesome.

The concept is pretty nice too :D

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Mon Mar 28, 2011 11:53 pm
by yamashi
Ogre can't render that many cubes, it's impossible for our current hardware...
It's the algorithm I made to cull away hidden faces, cubes and chunks that makes this possible !
I might explain how it works when I find time to do so ;)

Let's say that the "cubes" that you see aren't cubes !

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 12:49 am
by TechnoBulldog
yamashi wrote:Ogre can't render that many cubes, it's impossible for our current hardware...
It's the algorithm I made to cull away hidden faces, cubes and chunks that makes this possible !
I might explain how it works when I find time to do so ;)

Let's say that the "cubes" that you see aren't cubes !
So what you're saying is that the only faces rendered are the ones you see? All of the others ones are removed?

That's pretty cool, I would love to learn how you did this :D

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 12:59 am
by _tommo_
Minecraft also does that, you just have to tesselate only the faces that are in the middle between an empty and an occupied block.
Rendering the actual cubes would be just crazy :D

I'm doing this myself for a simple project of mine:

Image

The screenshot is old, now it runs at ~340 fps with culling on my 8600 GT, but it is not Ogre but plain OpenGL.

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 1:21 am
by Praetorian
Haha, I've been playing with something like this on and off as well :) (this is an old shot, I have simple terrain gen and such working now):

Image

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 2:00 am
by LBDude
I'm doing a minecraft game also...

Some recent screenshots. It's not doing "cave" lighting yet (AO), working on that, soon.

http://imgur.com/a/SfEhR#G1ekM

Earlier I was doing 1078x1078x256 dimension for terrain. I'm running total 512x512x256 currently to work on things. Maybe eventually I will up the dimensions again. Anyways, I'm not really going to do a carbon copy of Minecraft. It's more DF than MC. Also have my own things planned.

Also some videos:

http://www.youtube.com/user/Beyznd?feat ... ke_KJIk5bs

follow my blog:

http://fdastero.tumblr.com/
twitter:
http://twitter.com/fdastero

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 9:48 am
by _tommo_
Is there someone that ISN'T making a minecraft clone? :P

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 9:59 am
by spacegaier
[OT]
ME :D ! If any, then I am currently cloning "Freelancer"...
[/OT]

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 10:23 am
by yamashi
Update !

I have been doing some testing, I multithreaded the whole thing and now I get about 200 FPS with 20 x 20 chunks : 13.1 million cubes.
I will probably be adding lighting this afternoon !

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 10:36 am
by Mikachu
_tommo_ wrote:Is there someone that ISN'T making a minecraft clone? :P
Cool! 8)
It means less people trying to create a World of Warcraft clone... :lol:

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 4:13 pm
by Sgw32
Just a question, do you use static geometry or just 10.6 million of Ogre Nodes? :D
Also, has your project any lighting?

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 6:01 pm
by betajaen
_tommo_ wrote:Is there someone that ISN'T making a minecraft clone? :P
Image

Well look at that. ;)

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 6:47 pm
by Herb
Is anyone willing to open up some source for this voxel rendering? :D I'm curious on how some of you are implementing this within Ogre.

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 7:26 pm
by _tommo_
My code is open source but unfortunately it is not Ogre-based :roll:
But it should be easy to use "ManualObject" instead of "Mesh" :wink:

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 7:30 pm
by betajaen
Mine isn't voxels. It's just 5 sides of a cube rendered towards the camera. It isn't even a Minecraft clone, it was intended to be a blocky version of Virus.

I did pinch the textures from a Minecraft texture pack though. ;)

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 7:34 pm
by PolyVox
Herb wrote:Is anyone willing to open up some source for this voxel rendering? :D I'm curious on how some of you are implementing this within Ogre.
I have an open source library available here: http://www.thermite3d.org

The library is called PolyVox, and the engine which combines it with Ogre is called Thermite3D. The main features of PolyVox are:
  • Storage of very large (paged) volumes
  • Surface extraction of both smooth and Minecraft style terrain,
  • Level of detail,
  • Ambient occlusion,
  • A* pathfinding,
  • Picking
  • Various other things.
Several people are using it with Ogre, including myself (Ogre3D forum thread is here).

It's written in C++ and is under the zlib license.

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Tue Mar 29, 2011 7:44 pm
by LBDude
Hey I use PolyVox.

My source is not opened *right* now... sorry :( and I don't think it's a good idea to use what I'm doing as an example either.

It's really easy to implement with PolyVox though, I'm also willing to share insights on implementation, lighting, rendering, etc.

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Wed Mar 30, 2011 10:49 am
by Lee04
Anyone looking for the "next" thing in blocky world games, contact me I have some nifty ideas that will transform the blocky world to the next level.

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Wed Mar 30, 2011 6:40 pm
by videl
Waiting for a "smoothcraft" with a smooth terrain and detailled objects :D

Looks great what you did so far

Re: Voxel rendering 10.6 million cubes at 120 fps :)

Posted: Wed Mar 30, 2011 6:50 pm
by PolyVox
videl wrote:Waiting for a "smoothcraft" with a smooth terrain and detailled objects :D
I haven't added any objects (though you can insert any Ogre mesh) but smooth voxel terrain is not difficult. See http://www.ogre3d.org/forums/viewtopic. ... 25#p364552

Of course building a game from it is more work... :wink: