Not logged inOpenClonk Forum
Up Topic General / Feedback and Ideas / voxel graphics
- - By K-Duke [de] Date 2009-06-07 18:23
There has been talking about 3D graphics to use in OpenClonk... you were worried about the amount of needed polygons when there are a lot of objects. Well take a look on Voxel graphics. A voxel basically is a VOlume piXEL. Therefore the same as a pixel for an image just for 3D. Clonk could definitely befinit from the advantages of a voxel engine compared to a normal polygon based 3D engine. I wonder if this might be an alternative for the usually used engines.

Here are 3 links to get an impression what voxel graphics are.

http://advsys.net/ken/voxlap.htm
http://voxels.blogspot.com/

A game inspired by Wolfenstein 3D... using a voxel engine.
http://voxelstein3d.sourceforge.net/

greetings
K-Duke
Parent - By Newton [es] Date 2009-06-07 18:43
Err....what??
Parent - - By B_E [de] Date 2009-06-08 16:39
Aren't Voxels less for graphics, but more for Landscapes or similar stuff? And even if you used voxels - voxels in 2d would look rather like it normally does...
Parent - By K-Duke [de] Date 2009-06-08 20:05
Voxel graphics can as well easily be used for graphics. For the argument it would look like a 2D pixel engine... well it would depend on how the voxels are rendered. Using raycasting (don't mix that up with raytracing!!) and a very simple jitter for the rays it would be possible to create an antialiased picture of the world.
Parent - - By Carli [de] Date 2009-06-08 16:49
voxelstein has a very cheap voxel engine.
i think the gwx voxels are better in graphics quality: http://www.youtube.com/watch?v=0RhDQiHMfuY
Parent - By K-Duke [de] Date 2009-06-08 20:05
Yeah indeed. This one definitely looks better ^^
Parent - - By henry [de] Date 2009-06-09 07:09

>voxelstein has a very cheap voxel engine.


Their voxelmaps have also slightly higher resoulitions.
Parent - - By Carli [de] Date 2009-06-10 12:59
they have a higher resulution but the results are worse because it's a cube-voxel engine.
Parent - By henry [de] Date 2009-06-14 18:12
The result isn't worse in my opinion.
For example you can even shoot tiny holes in the walls.

I think both approaches have their advantages.
Parent - - By Sven2 [us] Date 2009-06-08 23:49
Voxel engines lacks widespread acceleration. They generally have larger volumes of data to be pushed around. All common 3D modelers work on polygons.

Can you name any concrete benefit from using a completely nonstandard approach?
Parent - - By ker [se] Date 2009-06-09 08:19
http://www.thermite3d.org/ << this one does quite well... converts voxels to polygon's for display and physics.

benefit: zooming in won't create pixel-blocks... instead the precision of the converter can be adjusted for smoother graphics. physics can still be done in a synchronizable way by not adjusting them.
benefit2: smooth landscapes, easy texturing

disadvantage: sharp landscapes are not possible w/ the standard version of the engine.
Parent - - By Newton [es] Date 2009-06-09 11:44
I still don't understand what this has to do with OpenClonk. OpenClonk is 2D and is using Pixels for "fully destructable landscapes". What exactly is the idea here?

I think all this stuff is more interesting for GWX.
Parent - - By ker [se] Date 2009-06-09 13:10
it's basically just for better looks + easier use of polygons for physics...
the looks will even be adjustable per computer w/o interfering w/ the network synchronization. You can make explosions create holes in the background (better computer -> looks expand a few layers into the back, bad computer -> only use the front layer)
I know it's only used for 3d in that project, but the difference of 3d and 2d is just that 2d is looking along a single 3d axis.

and for the physics, I have not read much about it here, but from what I remember ppl want to use polygon physics engines and polygon landscapes.?

[edit] sorry about the confusion, the topic starter wanted to create voxelbased models for ingame objects, not landscape, since the landscape is basically already voxels (1xNxM voxelspace == NxM pixelspace ^^)
Parent - - By Sven2 [us] Date 2009-06-09 14:36

> it's basically just for better looks


I haven't seen any engine that would produce superior graphics yet. Polygon-based graphics technology is much more advanced.

> + easier use of polygons for physics...


So you're talking about physical interactions between objects? How will they become "easier"?

> I know it's only used for 3d in that project, but the difference of 3d and 2d is just that 2d is looking along a single 3d axis.


Yes, and a "2D voxel engine" is a pixel-based engine. It's what we have right now. We want to move to polygon-based models for objects because the pixel-based approach (read: Have all animation phases pre-rendered) doesn't scale well and takes too much memory on high resolutions. We aren't moving to polygon-based landscape, as noone has written that approach (yet).

You want to make the situation worse instead by adding a new dimension of pixels that is actually almost never seen.
Parent - By ker [lv] Date 2009-06-09 17:28
the new dimension was just a random feature that would come from that.

The most important thing would be still having the pixel landscape but rendering it with 3d polygons (smooth landscape, no pixel blocks)
and it would allow for polygon landscapes for physics which have been discussed somewhere, I just don't remember where
Parent - - By Zapper [de] Date 2009-06-09 14:36

>and for the physics, I have not read much about it here, but from what I remember ppl want to use polygon physics engines and polygon landscapes.?


So why don't we use polygon graphics as well?
Parent - - By ker [lv] Date 2009-06-09 17:30
we would be using them... have you not taken a look at the link? the background data is still voxels/pixels, just the display and physics will be polygonal and updated when the voxel/pixels update.
it will allow for any level of smoothness for the landscape, no matter what the zoom. b/c right now even if you'd use 3d models for objects, the landscape will still be flat pixels w/ some kind of bumpmap/lightmap/whatever
Parent - - By Zapper [de] Date 2009-06-09 18:39

>we would be using them... have you not taken a look at the link? the background data is still voxels/pixels, just the display and physics will be polygonal and updated when the voxel/pixels update.


Exactly, why not use polygons in the background data as well?

>it will allow for any level of smoothness for the landscape, no matter what the zoom


Right now we HAVE a voxel engine for the landscape. It is 2d, okay. So the voxels lack a third dimension and are therefore called pixels. But I cannot really see any difference when we add a third dimension (which you don't see anyway)
Parent - - By ker [lv] Date 2009-06-09 20:28
you can do it directly with polygons... it will be crazy to synchronize thou... and needs gazillions of weird algorithms to allow the current method of destructability.

about synchronization: ok... the physics engine w/ polygons would introduce problems...

call it voxel, call it pixel, the point is that clonk will have blocky thingies there which can only look smoother by increasing the resolution (which might not be possible on all computers b/c there'll be good and bad computers in a game). w/ the voxel -> polygon converter you can create a smooth surface that is smooth at any zoom if the computer allows it (irregardless of all the other computers).

as said before, the third dimension is irrelevant, it's only a feature that could be abused for graphical effects. All I care about so far is the smooth landscape (which will look 3d since the polygons will actually be around voxels of 1 voxel depth (so basically a pixel that is extended into the back))
Parent - - By Zapper [de] Date 2009-06-09 20:52
Umpf, my point was why we should use voxels at all. We can use polygon stuff just fine.
Parent - - By ker [se] Date 2009-06-10 11:21
:) I'd be happy if someone'd prove me wrong, since I've wanted to see a modifiable polygon world for a long time. I just think it's not gonna work.
Parent - - By Newton [es] Date 2009-06-10 11:41
Binary operations on polygons are not _that_ difficult.
http://revar.livejournal.com/81627.html
Parent - By ker [se] Date 2009-06-10 14:28
yea, but they will allow the creation of ANY possible polygon... which might create very very messy maps... (well... like currently w/ single pixels hanging around and stuff...)
Parent - - By Newton [es] Date 2009-06-09 21:13
OK, let me summarize this topic.

Your proposal is basically: Leave the data structure of a two-dimensional pixel array as it is but have a second polygon based data representation of the landscape. The polygon based representation of the landscape is used for graphics and for the physics engine. It will be updated automatically on every change to the landscape. This is supposed to work with less effort and faster than using a modifiable polygon based landscape directly.

And this is were I loose you. Why do you think creating the polygons after each change on the landscape is A) less complicated to program and B) faster than directly modifying  the polygons?
Parent - By ker [se] Date 2009-06-10 11:17
I've seen the polyvox engine work, it's extremely fast and doesn't need many resources.

for A:
it can basically be used as a black box that gets pixel map input and returns the polygons which then can be drawn imediately. when the map changes, you tell that to the black box and your polygon output changes. I've even seen this technology be used for streaming infinite size maps.

for B: might not be faster, but it won't end up creating crazy polygons that are extremely thin and look more like errors than like map-parts. You will always generate your polygon world from a discrete world, so if you get messy stuff the generator is bad, but w/ a polygon world that is modified directly, anything is possible. I've not seen a good polygon-engine with on the fly modification so far. So this is just guess work and some experience w/ an experiment I did about a year ago (or maybe I'm just crappy @ polygon-math ;) )
Parent - - By Carli [de] Date 2009-06-10 13:05
omg. why do we need a 1*M*N voxelspace when we can use marching squares for pixels instead of marching cubes for voxels
Parent - - By ker [se] Date 2009-06-10 14:28
the total space you have will still be 1*M*N...
Parent - - By Carli [de] Date 2009-06-10 15:14
but voxelmaps are senseless in 2D, "voxel" does mean 3D-Pixels, but not how they are drawn (we have already _pixels_)
what you think of is a marching cubes algorithm for 2D-Maps (called marching squares)
Parent - - By ker [lv] Date 2009-06-10 17:07
no I want a 3d effect like the devs created in CR for the map. so it would still need to be marching cubes :) so yes, you still store your data as pixels... just interpret them as voxels... or however you want to think of it :)
Parent - By Carli [de] Date 2009-06-11 08:01
then you have to take a marching squares algorithm and only calculate the landscape normals with a imaginative voxel system (see gwx-code, it has a good (smooth) normal calculating for voxels)
Parent - - By K-Duke [de] Date 2009-06-10 07:29
First of i'd like to apologize for not having replied for some time.

As ker said the basic idea behind this proposal is having better graphics.

> Sven2 said: Yes, and a "2D voxel engine" is a pixel-based engine. It's what we have right now.


Actually not. In an pixel based engine a screen-pixel has the same size as an object-pixel. In a voxel engine the voxels can be even smaller than a screen-pixel, thats where the graphics start to get better than in pixel-engines.
If the voxels are smaller than a pixel, like one fourth you could achieve a pretty easy antialiasing using ray casting (note: ray casting, not ray tracing. Ray casting has already been used in very old games, when PCs used to be much slower like 66 mhz). You cast like 4 jittered rays per screen-pixel resulting in an anti-aliased image of the current scene, given that a voxel is smaller than a pixel. Furthermore using a tree representation of the voxel-data, their position would be defined by the data-structure instead of coordinates. Although I haven't been into network programming yet, this might be benefitial for network synchronisation as less data has to be transfered.
Extending on the tree data representation you could have a fluid LoD enabling scalability in a much more effective way than pixel engines could achieve. Compared to polygon models you as well don't have to create seperate models for LoD. This can be automatically done by adjusting the tree-walking depth depending on zoom.

And then of course you got your rotatable 3D objects which are easier to animate than 2D images. One can even create convential polygon models and convert them into a voxel model. The advantage here is that you don't have to make several conversions compared to 2D where you have a small image of every animation step.

Another advantage I know of is that having your models actually solid you'd have a collision mask in itself by the voxel representation.

Of course this technology has a big disadvantage, one can't close ones eyes from it. As Sven2 said it lacks hardware acceleration. Though I think it's not that much of an issue as we wouldn't have that much data compared to a real 3D environment.

If something still not clear please ask me...
Parent - - By Zapper [de] Date 2009-06-10 07:48

>The advantage here is that you don't have to make several conversions compared to 2D where you have a small image of every animation step.


But the modell-data that is finally saved and the engine has to import consists still of one "image" per animation step or doesn't it? I think a bone system is more efficient using polygon modells

>Another advantage I know of is that having your models actually solid you'd have a collision mask in itself by the voxel representation.


That is the only reason I see up to now - but it's not like that realistic collisions cannot be done in a polygon-based environment

The other advantage you mention, that the LoD can be scaled dynamically, does not weight more than the additional loading data (if it really is that way), I think
Parent - - By K-Duke [de] Date 2009-06-10 12:45
As far as I know it is possible to use bone animation on voxel models as well. You don't have to save several different voxel models for animation.
Parent - - By ker [se] Date 2009-06-10 14:30
I can confirm this. ken silverman's engine allows this for example. It is also used in voxelstein 3d.

He does this by streching the voxels to fit the bone system.
Parent - - By Zapper [de] Date 2009-06-10 15:45
But streched voxels lower the resolution even more, don't they? I cannot imagine how it could look as good as a well built polygon engine/model
Parent - By ker [lv] Date 2009-06-10 17:06
I never said voxel based object modeling would look good ;) just that it works, with bones and LoD
Parent - - By K-Duke [de] Date 2009-06-10 07:44
Oh yeah I forgot something.

> Sven2 said: They [voxels] generally have larger volumes of data to be pushed around.


This is true. Though one could circumvent this problem to some extend by using tree-data representation. One could even adjust it in a way that you only have walk the tree so much that one voxel has the size of one screen-pixel reducing the rendering data greatly for slow PCs. Though granted this would almost look like the convential 2D engine with a higher amount of data. Though really... do we still have to support a 300 mhz PC from 1998?
Parent - - By Carli [de] Date 2009-06-11 08:05
forget it.
make an extra branch, implement your voxel landscape and when 3 GHz are fast enough we will use your landscape engine in the main branch.
Parent - - By K-Duke [de] Date 2009-06-16 21:39
Hi Carli... actually I already started doing so...
It's not that I'd like to push everything into that direction though I would like to try and see how it will perform.
Although this is interesting I will be concentrating more on the "officially" taken approach as I neither want to have several different Open Clonk builds nor am I interested in splitting developers into a voxel- and a non-voxel-camp. I'd say the biggest advantage of open source is to work together. Not that everyone can take the source and make their own builds.

To cut a long story short (lange Rede, kurzer Sinn):
Together we code... divided we fall.
Parent - By Carli [de] Date 2009-06-17 14:34
i got a better idea:
in this thread we discussed how to implement more than one landscape system: http://forum.openclonk.org/topic_show.pl?pid=2164#pid2164
Parent - By Atomclonk [de] Date 2009-06-11 09:53
We have already performace problems... so, full ack with Carli.
Reply
Up Topic General / Feedback and Ideas / voxel graphics

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill