How do I make a voxel renderer?

Started by
7 comments, last by larspensjo 11 years, 9 months ago
What do i need to know, or what tools do i need, to program a voxel renderer. Do i need openGl or something different?

I want to make one for a school project. I just need to render a sphere in a voxel renderer but i have no idea where to begin.

Thanks in advance,
Dartos
Advertisement
You probably want to make a mesh out of the voxel grid, which requires openGL, directX or some higher level library/engine. You can also find libraries to create the mesh for you out of voxels.

It works so that it finds all voxels exposed to air (or other transparent block types), and adds the visible surfaces to the mesh using triangles. It might also use a smoothing algorithm of some sort so that the triangles it adds depend on the neighboring nodes (marching cubes).

o3o

I made a voxel sphere once using a dynamic Octree versus the surface of a BoundingSphere.

Only had one view - From the front - But I could probably do better if I did it today.

Also, got about 2 SPF. DirectX 11 wasn't out and it was running on the CPU - And I wanted each box to be no bigger than a pixel.

Was quite spherical, though.
So I'm torn because when posters such as yourself ask a question like this in this way, I think to myself "what he's trying to do is waaaaaaaaaaay past his skill level. He should start with something smaller/easier." However, I don't want to push you away from experimenting and learning new things.

So I'll ask this, what research have you done on voxels and voxel renderers?

Beginner in Game Development?  Read here. And read here.

 


So I'm torn because when posters such as yourself ask a question like this in this way, I think to myself "what he's trying to do is waaaaaaaaaaay past his skill level. He should start with something smaller/easier." However, I don't want to push you away from experimenting and learning new things.

So I'll ask this, what research have you done on voxels and voxel renderers?


I know what a voxel renderer is and how it compares to a traditional polygon renderer. There is nothing wrong with asking an advance question. If I find it too hard to do I will simply not do it until I can. There is no reason to say "I'm not going to help you because I think you don't know enough." So please don't post things like that again. Its kinda hurtful.

I know what a voxel renderer is and how it compares to a traditional polygon renderer.


In that case, turn your voxels into polygons, then you can render them like you always have.

Marching cubes is the go-to first solution for that kinda thing.
Perhaps it's just me but I suggest to Don't start yet another voxel project.
Voxels have been around for ages. They never bought me in as a start and no matter how hard I look, I still don't see much reasons to use them. Not to render at least. For storage, for point clouds we could discuss but for rendering... I'll just pass.

Do i need openGl or something different?
...
I know what a voxel renderer is and how it compares to a traditional polygon renderer.
You need something to draw pixels to screen. But if you're asking this, you're probably just better starting from 101. The "kinda hurtful" things some users myself included post above is called "realistic outcome": we are warning you might just trash a couple of months of your life for some hard-to-quantify benefit.

Previously "Krohm"

Simple voxel renderer is easy. Just use ray-casting and iterate over volume. Simple pixel shader is just enough. You can found bunch of examples via. google.

Second choice is to transfer volume into polygonal model. Here I recomend to start with Marching Cubes. Polygonal model is than rendered as classic geometry.

Bigger problem I have with voxels is not enough "real-world" models. Its fine for output from some mathematical simulation or CT/MRI etc... But found real models like house, car etc. is almost impossible.
If I understand the idea behind "Marching Cubes", it is not good enough. It will create nice surfaces between voxels, but what texture would you use when the surfaces span between two different material types?

Also, some voxels should stay blocky, like bricks, while some can be allowed to be smoothed. I would recommend to first generate a mesh from the visible surfaces, and then start experimenting with smoothing algorithms.

I wish you good luck, and I know you will learn a lot. It is quite fun.
[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

This topic is closed to new replies.

Advertisement