What is a voxel?

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 1304 Views - Last Post: 20 July 2012 - 04:17 PM Rate Topic: -----

#1 dartoscoder  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 313
  • Joined: 15-May 09

What is a voxel?

Posted 17 July 2012 - 10:38 AM

I was looking aorund the internets for information on rendering and I came across voxels. I tried to look for some information on them but none of it makes sense as to how they can be used in actual rendering.

I read that minecraft uses voxels but I always thought they used polygons (because it is a game of cubes).

I would like it if someone could tell me (or give me a site that tells me) what a voxel is and to some extent how to implement them.

I am not looking to make anything big I just want to toy around with voxels.

thanks,
dartos

Is This A Good Question/Topic? 0
  • +

Replies To: What is a voxel?

#2 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7746
  • View blog
  • Posts: 13,103
  • Joined: 19-March 11

Re: What is a voxel?

Posted 17 July 2012 - 10:41 AM

What's a voxel? Apparently it's a volume element representing a value on a three-dimensional rectangular grid.

The first place I'd assume you'd start playing with these would be in a 3d array.
This is likely not going to work out, but the best way to find out why an obvious idea isn't a good idea is to try it and see what walls you crash into.
Was This Post Helpful? 0
  • +
  • -

#3 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1356
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: What is a voxel?

Posted 17 July 2012 - 10:43 AM

It's sort of like a 3D pixel, or volumetric pixel which is where the name voxel comes from, represented by a cube. The link that jon.kiparsky posted should sum it up quite nicely.

EDIT: Also, I read somewhere, can't remember where now, that Notch didn't use voxels for Minecraft, he used a static mesh cube that had textures applied to it based on the type of terrain or ore that each cube was supposed to be.

This post has been edited by Kilorn: 17 July 2012 - 10:44 AM

Was This Post Helpful? 0
  • +
  • -

#4 dartoscoder  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 313
  • Joined: 15-May 09

Re: What is a voxel?

Posted 17 July 2012 - 10:46 AM

So it's just a point in 3d space. Like a vertex?
Was This Post Helpful? 0
  • +
  • -

#5 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1356
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: What is a voxel?

Posted 17 July 2012 - 10:48 AM

Not exactly. Voxels actually have a volume, where a vertex doesn't. A vertex is just a single point.
Was This Post Helpful? 0
  • +
  • -

#6 dartoscoder  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 313
  • Joined: 15-May 09

Re: What is a voxel?

Posted 17 July 2012 - 10:57 AM

So a voxel is more like a unit cube? Then why render with that vs a polygon? I know voxels are not used in gaming so much but why even use them in the sciences?
Was This Post Helpful? 0
  • +
  • -

#7 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1356
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: What is a voxel?

Posted 17 July 2012 - 11:10 AM

That's a question that I can't answer. I've never worked with voxels before. I do know that voxels are useful for creating terrain in games that allows for a lot more flexibility than a heightmap as you can procedurally produce cave systems and overhangs where a heightmap can only create terrain based on a single value of a 2D image to represent the height of the terrain at any specific point. Beyond that, I'm not really sure how they could be useful for game development, but I do know that they are used extensively in the medical field to represent data from MRI's and CT scans.
Was This Post Helpful? 0
  • +
  • -

#8 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 579
  • View blog
  • Posts: 1,285
  • Joined: 24-April 12

Re: What is a voxel?

Posted 17 July 2012 - 03:12 PM

I'm still kind of trying to figure out what voxels are myself. But someone correct me if I'm wrong here. I don't think any hardware graphics cards can render anything other than a triangle(polygon), line, or dot. (Really it's all dots when it gets to the pixel shader.)

My understanding is that a voxel is just a box. I think the graphics card would have no choice but to render it a series of triangles in the shape of a box, although you would only have to render the ones that are visable from the camera.

When I think of voxels I think of Minecraft. That's the only legitimate use of voxels I've seen.

It kind of makes sense to me as a 3D unit, especially mathematically. I mean octrees are essentially a tree of voxels, at least by the way I see voxels anyway.

I just think in terms of drawing 2D images with pixels and "drawing" 3D images with voxels. I mean you can kind of think of pixels as squares (although I'm not sure what shape they actually take these days). And then you can imagine extending it into 3D and it becomes a box. And if you had a 3D printer it would make sense that it would print voxels, to me anyway.

Maybe I'm wrong but I just think of them as 3D representations of space, like an octree. In fact, I would imagine I would use an octree if I were using them in a game. I don't know that a pixel has a defined size, and I don't know that a voxel does either.
Was This Post Helpful? 0
  • +
  • -

#9 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 579
  • View blog
  • Posts: 1,285
  • Joined: 24-April 12

Re: What is a voxel?

Posted 17 July 2012 - 04:42 PM

Oh. I also think part of the concept of voxels is that they're discreet.

Points are infinate. Or more accurately, they are infintesimal. Between point 2 and point 3 is an infinate number of fractional points.

Pixels are discreet. There is no such thing as 2.6 pixels, just like there's no such thing as having 2.6 kids. They're integers. They can't have a fractional part.

Points are real numbers that always have a fractional part.

I think, likewise, voxels are discreet and represented by integers. There's nothing in between voxel 2 and voxel 3; you immediately go from one to the other.

But again, I'm just kind of telling you what I "believe" on what I've heard and seen. I'm not sure that my concept of voxels is "correct".
Was This Post Helpful? 0
  • +
  • -

#10 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: What is a voxel?

Posted 17 July 2012 - 09:13 PM

You do realize that 'infinite' and 'infinitesimal' are completely opposite ends if the spectrum, right? One does not imply the other.
Was This Post Helpful? 0
  • +
  • -

#11 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 579
  • View blog
  • Posts: 1,285
  • Joined: 24-April 12

Re: What is a voxel?

Posted 18 July 2012 - 07:23 AM

Yes. That's why I corrected myself by saying infintesimal. Maybe I should have just erased the infinite statement.

What I meant is that I believe voxels, or pixels for that matter, are infinate (limited only by the hardware). That is, you can have any number of them. However, because they are discreet, there's nothing in between them. So, the values between them aren't infintesimal (infinately small).

I meant to draw a comparison there with points which not only are unlimited in how many you can have (like voxels), but are also unlimited in the fractions that you can have between points (infintesimal) which is totally unlike voxels, which have no points between them (discreet).

(I don't have a spell checker installed. So forgive my spelling.) :-)
Was This Post Helpful? 0
  • +
  • -

#12 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: What is a voxel?

Posted 19 July 2012 - 09:26 AM

The thing is, using pixels as an example that can be extended to voxels, they most certainly cannot be infinite. Why? Because when you reference a pixel you are referencing a defined picture element on a finite grid. I'm not sure where your analogy is coming from, it's not making sense to me.
Was This Post Helpful? 0
  • +
  • -

#13 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 579
  • View blog
  • Posts: 1,285
  • Joined: 24-April 12

Re: What is a voxel?

Posted 19 July 2012 - 09:36 AM

Pixels are not part of a finite grid. There are an infinite number of screen resolutions and aspect ratios possible in the universe. The only limitation is the hardware, which is a very real limitation but still artificial in the sense that you eventually can upgrade your hardware.

You could pick any aspect of computer programming and say it's finite according to the hardware it runs on. That doesn't make it inherently finite. It just makes it a limitation of the current hardware.

This post has been edited by BBeck: 19 July 2012 - 01:36 PM

Was This Post Helpful? 0
  • +
  • -

#14 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: What is a voxel?

Posted 19 July 2012 - 12:23 PM

?
Was This Post Helpful? 0
  • +
  • -

#15 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 579
  • View blog
  • Posts: 1,285
  • Joined: 24-April 12

Re: What is a voxel?

Posted 19 July 2012 - 01:26 PM

View PostButchDean, on 19 July 2012 - 12:23 PM, said:

?


Ok. So let's review.

Dartoscoder asked:

View Postdartoscoder, on 17 July 2012 - 10:46 AM, said:

So it[a voxel]'s just a point in 3d space. Like a vertex?


So, to answer that question, I discussed how voxels and points/vertices are different. But to contrast that, I also pointed out how they are similar.

As part of pointing out how a point, or vertex, is similar to a voxel, or a pixel, I pointed out that all four are infinite in the sense that you can have any possible number of them. Obviously, this is limited by artificial limitations such as user/programmer limitations that specify a limit, such as specifying a screen resolution or specifying a specific array or grid size. It's also limited by hardware limitiations and what's "practical". But all of those are artificial limitations that are arbitrarily chosen by someone and can easily be overcome with someone else increasing the limitation. For example, the next programmer could specify a larger screen resolution and then you have more pixels. The maximum number of pixels is an arbitrary limit imposed by someone, not an "inherent" attribute of a pixel. The bottom line is - hardware and choice willing - there is no limit on how many of these things you can have. That makes them infinite.

However, that's just belaboring a minor point that was nothing more than a contrast to the main point, and largely unimportant other than a way of elaborating on the main point. And the main point was:

Voxels and pixels are discreet while points and vertices are not.

That is how they are different.

In order to elaborate and further explain that statement I pointed out that there are an infinite number of points or vertices between two points or two vertices. Again, of course, there are hardware limitations based on the datatypes you are using to store them. But there is nothing "inherent" in the concept that imposes a fixed limit. For all practical purposes, the concept of two points allows for an infinite number of points between them.

While the number of points between two points is infinite in that the number of them can continue to grow larger for ever, their values are actually infintesimal, that is that each point between two points can become infinitely smaller and smaller without any limit (other than artificial limitations imposed by the datatypes, programmer, hardware, etc.)

That is not true for voxels or pixels because they are discreet and only represented by integers and not real or fractional numbers. The exact number of voxels between two voxels is always and forever zero because there is nothing between voxels. The same can be said for pixels. This is at direct contrast with points and vertices which can have an infinite number of points that grow infinitesimally smaller and small forever.

Comparing how all four can grow in number forever, to how they are different in their ability to shrink beyond whole numbers illustrates the differences between points and voxels. It also implies that voxels are an element of volume as previously mentioned.

I hope that helps you understand.

This post has been edited by BBeck: 19 July 2012 - 01:52 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2