Game Development Community

Making a SkyBox

by Mike Henry · in Torque 3D Professional · 01/21/2010 (12:00 am) · 3 replies

Does anyone know how make a SkyBox from a few sky jpg's?
There seems to be no way to do it in the World Editor.
I've been all through the documentation and this forum,
and I'm not seeing it anywhere.

About the author

Engineer technician in electronics plant. Plus part time map software and trailguide author and photographer.


#1
01/21/2010 (4:03 am)
As I recall, there are some examples in the game/art directory of your project (mayby start a new Full Project), I think in the skies map, but not certain. You have to create a cubemap in a materials.cs file, which is mainly a list of 6 images. You have to rotate some of the images to display them correctly.

Usually I make copies of the images and number them with a paint program, then create the list and display them. With the numbers in the images you can quickly see which images have to be rotated.

Right now I am at work, but if you like I can send you an example.
#2
01/21/2010 (9:20 am)
Now here's an oldie: tork.beffy.de/tutorials/skyboxes/skybox_setup.php Not everything still stands-up today, but the image should give a decent hint on how it works.

As Richard says, it's usually best to draw numbers on your textures as a test, and then rotate and swap them until it all fits correctly - then use that as a template. (which I appear not to have copied over when I switched to my new HD - dang!)

For the script file: material.cs
//obviously check your location and texture names...
singleton CubemapData( Cubemaptest1 )
{
   cubeFace[0] = "art/skies/cubemaptest1/cmtest1_2.png";
   cubeFace[1] = "art/skies/cubemaptest1/cmtest1_4.png";
   cubeFace[2] = "art/skies/cubemaptest1/cmtest1_3.png";
   cubeFace[3] = "art/skies/cubemaptest1/cmtest1_1.png";
   cubeFace[4] = "art/skies/cubemaptest1/cmtest1_5.png";
   cubeFace[5] = "art/skies/cubemaptest1/cmtest1_5.png";
};

singleton Material( cubemaptest1Mat )
{

   cubemap = Cubemaptest1;

};

T3D skies do seem to include an old *.dml file (which is how skyboxes were ordered back in TGE/A) but it doesn't seem to do anything now, and so I expect is redundant.

Just to note, the last time I checked the order for a cubemap as a reflection wasn't the same order as for a skybox - even though they use the same textures.
#3
01/21/2010 (10:00 am)
Thanks for the Info.
I probably should have mentioned in the first message that I did create create a material.cs file, just like shown above, but it didn't appear on the edit-material popup box. Turns out I had the Sky folders in the Game\Core\Art folder instead of the Game\Art folder. It seems to work now, but the individual images need to be rotated compared to how they were in TGE - they're oriented as if peeled from a cube map, rather than from a NSEW sky map. That will make it mighty tough to straighten out because it will have to be done in a photo editor rather than just changing file names.