Game Development Community

Skycube chaos

by Heiko Irrgang · in Torque 3D Professional · 06/27/2009 (6:06 am) · 10 replies

Hello,

i currently try to make a own skycube, so i have 6 images and created a material.cs:

singleton CubemapData( FullMoonSkyMapCubemap )
{
cubeFace[0] = "./FullMoonLeft2048";
cubeFace[1] = "./FullMoonRight2048";
cubeFace[2] = "./FullMoonFront2048";
cubeFace[3] = "./FullMoonBack2048";
cubeFace[4] = "./FullMoonUp2048";
cubeFace[5] = "./FullMoonDown2048";
};

but it ends up in complete chaos, they are rotated and left is right, and so on, so what is the right order for the cube faces, and how do they have to be rotated/mirrored?

#1
06/27/2009 (9:06 am)
It is the MSDN cubemap scheme.
If you can't find it i will send it to you.
It is a good idea to have an email in your profile information.
#2
06/27/2009 (9:22 am)
thanx, tried to search it up, even on msdn itself, but didn't find anything about it.

if you could send it to me i would be happy, email should be visible now.
#3
06/27/2009 (9:57 am)
yahoo could not send my message,so:
rapidshare.com/files/249290901/document.pdf
#4
06/27/2009 (10:03 am)
Make a template skybox, write the face names/numbers on them, see how it displays in-game, change until it works.

Try this, it's not what I usually use as a reference ... can't find that link...
springrts.com/wiki/images/6/69/Skyboxsimple.gif
#5
06/27/2009 (10:00 pm)
thanx, so this is what i came up with your information

singleton CubemapData( FullMoonSkyMapCubemap )
{
cubeFace[0] = "./FullMoonRight2048";
cubeFace[1] = "./FullMoonLeft2048";
cubeFace[2] = "./FullMoonUp2048";
cubeFace[3] = "./FullMoonDown2048";
cubeFace[4] = "./FullMoonBack2048";
cubeFace[5] = "./FullMoonFront2048";
}

but there are two problems remaining:

a) the up image is rotated 180 degrees, which makes sense when i would make that t-shaped texture myself

b) the whole skycube looks like rotated 90 degrees around x axis, so the water ends up in the front and the sky ends up in the back
#6
06/28/2009 (12:07 am)
It is possible that your images are not set up correctly.
I always use an image editor like Photoshop,
insert all the faces and order them like the scheme.
Watch how the edges of each face fit together.
If there is a problem - you rotate each of them untill all of them fits fine.
Then save each of them.
#7
06/28/2009 (6:39 am)
As Picasso says.
1. drag all images onto template as layers
2. flip individual layers hoizontally where neccessary
3. Drag layers back onto original images
4. Flatten and save images

If it all fits together over the template, it'll work in-game.
#8
06/28/2009 (7:17 am)
I just setup this one in TGEA based on an HDR image that I converted out to a cubemap. The info in TDN appeared incorrect with regards to the orientation, so I had to fiddle with things to get it to work, here is the info I used along with the rotation values.

new CubemapData( suburbCube )
{
   cubeFace[0] = "left"; //rotate 90 ccw
   cubeFace[1] = "right"; //rotate 90 cw
   cubeFace[2] = "front"; //rotate 180
   cubeFace[3] = "back"; //no change needed
   cubeFace[4] = "top"; //rotate 180
   cubeFace[5] = "bottom"; //no change needed
};

I could be totally wrong with the rotation values I used, but the cubemap seemed seamless to me and like I said I generated it from an HDR image file that had full sky and ground, so any seams or issues with the alignment would show like a sore thumb.
#9
07/29/2009 (5:07 am)
thanx for all your help, @logan, left/right seem to be switched, rest fine.

just to ease up the task for the future, i made a little freeware programm which can build a skybox incl. cs file.

maybe it comes in handy for torque users:

93-interactive.com/cms/texturebuilder/
#10
07/29/2009 (5:29 am)
That's a sweet little app Heiko. Thanks!