OK, Voxels

Posted by aeron on Nov. 3, 2012, 11:04 p.m.

Picking up from 2 blogs ago, I switched to Irrlicht and started working on texturing. A picture's worth a thousand words, so I'll shortcut by about 7000 this blog :)

After getting paging to work, I got some perlin noise loading in chunks:

Pushing it a little harder, because I can:

Now texturing is the tricky part. After working up the courage to tackle this beast, I loaded a simple texture and slapped on some UV coordinates:

Wait, have I deceived myself with how difficult this is? Okay but what if I want to support different material textures? I organize a couple textures in an atlas and start dialing in the UV coordinates:

Damn, it really was too good to be true. Okay fuck it I'll hack it by using modf:

I got rid of the black grid and it's starting to look more coherent. But alas the textures are reflected every other block producing noticeable patterns:

Well I seam to have coded myself into a corner. It's obvious my naive handling of vertex UVs won't release me from this type of problem, so I just started playing around with numbers. I ended up with this:

Definitely a cool look, but not what I'm going for. So I'm gonna have to approach this from a different angle, I found some code that implements the UV mapping I want in a shader which might be a viable method. I'm also looking into another method that involves texture arrays (which would ultimately have to be implemented in a shader as well). The latter method relies on slightly newer hardware but if I went that route I could reap the benefit of mipmaps, normal maps, and filtering without any bleeding along the borders. At the same time I'm perfectly happy without any of those things (I can't say I'm not fond of the pixellated style).

Anywho, that's all I have for now my friendlies lolwut

Comments

Ferret 12 years, 1 month ago

Wooo! Looks awesome, sounds awesome, smells great too!

Should send Scott_AW any of your questions about voxels d:

death 12 years, 1 month ago

Yeah i like the last image, voxels are still interesting stuff.

Astryl 12 years, 1 month ago

Now that's looking really nice, aeron. What exactly are you going for with this, by the way?

Quote:
After getting paging to work,
Don't you mean page-flipping? Paging is a different process entirely, and is offered by default with most modern operating systems :P

Charlie Carlo 12 years, 1 month ago

This is cool. I've never understood this, so someone should clear this up for me. Are voxels a specific type of rendering or something? Or is it just a fancy nickname for a 6 polygon primitive?

Astryl 12 years, 1 month ago

Quote:
This is cool. I've never understood this, so someone should clear this up for me. Are voxels a specific type of rendering or something? Or is it just a fancy nickname for a 6 polygon primitive?

Depends on how you look at it. For some programmers, it's a way of describing a data structure that can store lots of points of data. For others, it's just unit cubes being used to render a world.

Charlie Carlo 12 years, 1 month ago

I meant in the graphics sort of way. I understand the name, pixels with volume. I just don't understand if there's an actual difference between using voxels versus using a shit ton of cubes.

death 12 years, 1 month ago

there's defiantly different ways you can render and store the information but graphically i don't think the player will be able to tell how they did it, they'll just see voxels :P

Astryl 12 years, 1 month ago

Quote:
I meant in the graphics sort of way. I understand the name, pixels with volume. I just don't understand if there's an actual difference between using voxels versus using a shit ton of cubes.
That's all implementation based. Minecraft is technically a voxel-based system, that uses Cubes. Ace of Spades uses specifically rendered 'patches', done in software. Then there's the Comanche style of rendering a column (A vertical line).

Charlie Carlo 12 years, 1 month ago

Oh, alright then. Is either easier for a graphics card to render?

aeron 12 years, 1 month ago

Quote:
Don't you mean page-flipping? Paging is a different process entirely, and is offered by default with most modern operating systems :P
Ah well I meant switching to a chunk-based data structure that supports paging if necessary. I should've said "paging volume"

Quote:
Oh, alright then. Is either easier for a graphics card to render?
My guess is the ones that use hardware can be faster (at least nowadays, wasn't always the case hence games like Comanche / Delta Force). But there's always more room for optimization it seems. Games like Crysis use voxels to render it's massive terrains by dynamically changing the Level of Detail further away from the camera. Unfortunately you have to smooth the voxels out so it wouldn't work for a minecraft-style renderer, but there's still other things you can do to simplify the geometry so it renders faster.

Quote:
Now that's looking really nice, aeron. What exactly are you going for with this, by the way?
I'm not completely sure, I have a few ideas spinning around but right now I'm just getting a testbed set up so I can move from there. While it could go a number of ways I don't want to make a sandbox game per se (no need for YAMC). It will partly be based on procedural generation, but I'm also looking at the possibility of a more or less "fixed" map designed by hand. Graphically, I'm inclined towards a Minecraft-like look and feel, but I'm willing to make greater distinctions particularly in the entity models.

I'm getting ahead of myself though. I'll definitely blog more about the game itself as I get more features working and start narrowing the direction the game will take. I'm always open to suggestions too :)