Cube Creation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Evanias
Posts: 6
Joined: Thu Jul 03, 2014 10:30 pm

Cube Creation

Post by Evanias »

Hello,
I am currently working on a project which uses a voxel-based world (cubes). The issue I am running into is with displaying these cubes. I have tried two different methods of creating my cubes, both of which have problems. The first method, and the most logical one, is to create cube scene nodes. This works perfectly fine, and I prefer this method as it's quite easy to do, but the problem is that I don't know how to texture individual sides of the cube (if that's even possible with Irrlicht). The second method I attempted was making cube objects and texturing those. That works properly, with one exception. As seen in the image below, I get ugly lines where the cubes meet. This may be some kind of Z fighting, but I don't know how to fix it, as I can't exactly have my cubes having spaces in between them. Does anybody know how to texture individual cube scene node sides, or how to fix the line problem? Thanks in advance!
-Evanias

P.S: Ignore the terrible tree in the background ;)
Image
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Cube Creation

Post by mongoose7 »

Do you have a 32-bit depth buffer? Have you set the near and far planes to bracket your scene?
Evanias
Posts: 6
Joined: Thu Jul 03, 2014 10:30 pm

Re: Cube Creation

Post by Evanias »

Well, call me a noob, but what are both of those things?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Cube Creation

Post by serengeor »

Just a small tip, if you inted to use scene nodes be sure to benchmark with max cubes on scene that you might have.
It's not too good of an approach if you;re going to have many (100~1000+). Each cube will most likelly have its own drawcall which will make things slow.

Also usually if you're doing some sort of voxel engine it doesn't make sense to have some sort of complex object around each voxel. You want to keep your voxels as simple as posible.
Working on game: Marrbles (Currently stopped).
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Cube Creation

Post by Asimov »

Heh heh forget the tree, has nobody noticed he is still using XP :D

If I was doing this I would put the texture on in 3ds max. The good thing about this if you had a texture sheet of 1024x1024 you could have many squares of texture in there and load it all in one go. This would cut down on the texture loading time, and you wouldn't have to worry about putting texture on each side of the square.

Don't worry if you have never done unwrapping before, because on a square it is easy.
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

Re: Cube Creation

Post by stefany »

I think that the problem is that in real games the world is not created by separated scenes nodes. That is the whole floor have to be one mesh, that is one scene node. And that is the hard part.

If you want to see how a quake based voxel editor work, see cube2 engine. It edits a quake level in minecraft-like way.
Post Reply