Creating a skybox for TGE using Skygen
by Alvaro F. Celis · 01/04/2003 (9:33 am) · 14 comments
I'm going to explain very briefly how I create simple skyboxes. Since Bryce is a bit expensive (although it creates amazing skyboxes) I started digging out the net until I found a very easy "skyboxing" program.
I still don't know how to post the pictures for this tutorial (I'll just post a screenshot)but as soon as I know how I promise I'll put all the tutorial pics up. Anyway, the tutorial is pretty straight forward, so let's get moving!!!
1.First of all download your copy of Skygen from:
www.logarithmic.co.uk . Remember to read his documents about using his software.
The download is pretty small. Just unzip it into any folder (i.e. Skygen) and double click on Skygen.exe (blue icon).
2.To give it a first try, just click on "randomise sky" the button on the upper right corner. Wait a bit while the program creates the box. Maximize the program so that you can see all the faces of the skybox. Now, let's try something else.
3.On the lower left corner you got a set of preset colours (or colors?). Pick any of them and then click on "change" to see how your sky changes. In my case, I'll pick black-red. Nice, huh?
4.Ok, now the exporting part. Go to file-export-bitmap files (bmp) and save the files. The program exports them in the proper order to work (left-front-right-back-top-bottom) so I recommend to name them something meaningful to you and assign them their corresponding number. In this case I named them darkred_0001, darkred_0002 and so on. We're done with skygen so now you may close it.
5.Go to the folder where you saved your images. Since TGE's skyboxes only work with Jpegs, we will need to turn them into such. I use Acdsee for this purpose, which is very versatile for simple tasks, but you may use any Image processing software. So turn them into jpegs trying to keep them in best quality. If you compress the images too much, the sky will look poor. Ready?
6. Now one last thing before going into your Torque folder.Image 0005 (top) needs to be rotated once 90 degrees counter-clockwise for it to fit seamlessly in the sybox. I don't know why this happens but if you just use it the way it comes out from skygen you will get seams. Again, for this purpose you may use Acdsee, Photoshop, Paintshop pro, etc etc etc. Just remember to rotate Image 0005 (top) 90 degrees counter clock-wise.
6-a (Addon) Rename image 0006 as 0007 since we will insert image 006 in the next step. Image 0007 will be the environment map for non textured objects in your level so what best than having your objects reflect the sky you are using.
7.Ok, now copy the images into your sample application skies folder (normally, fps\data\skies). Here you will see the default sky images (jpg), the default cloud images (png), and the default .dml scripts for the skybox to work properly.
8.Now, this step is critical. If you try to use the skybox only with the 6 images you got from skygen, the engine will crash. TGE needs 7 images for the skybox to work properly, so this is how we fix it. Copy one of TGE's sky images numbered 0006 and rename it as "yourfile"_0006. In my case: darkred_0006. This will create a full set for the skybox to work properly. This image in TGE is a small black square image, and corresponds to the ground and since we won't see it we can use any image for this but the easiest is to use image 0006 from a previous sky.
9.Now copy any of the .dml scripts in the "skies" folder and rename it as "yourfile".dml, in my case darkred.dml.
10.Using notepad, open your dml file, erase the text in it, and place the order of your jpegs. Each in one line followed by enter:
darkred_0001
darkred_0002
darkred_0003
darkred_0004
darkred_0005
darkred_0006
darkred_0007
save your .dml file.
11. And the last part. Go to your "missions" folder and locate the mission in which you want to use your skybox. Find the line that begins with: new Sky(Sky) {
and some 19 lines underneath it you will find a reference to a .dml file. Change it to your .dml file (darkred.dml). If you see a mess trying to read the script it means you must download the "Tribal ide" which is a programming text editor with some debugging and color coding capabilities (download it from the resources section).
12. And the fun part!!!Save your mission file and run your sample application. Pick the mission you inserted your skybox in and feel good! Nice, huh?
13.If you want to make it even more beautiful just add:
cloud1
at the end of your dml file, and bam! You got moving clouds. Cloud1 is the default .png file with transparency used by the sample app to simulate moving clouds. Be careful, it may not work sometimes with certain skyboxes (dunno why) making the engine crash. So if this happen, just delete the line from the dml.
14. Final ideas: in your skygen folder there's a folder called "ColourMaps" which contains all the color samples for skygen to work with. These are 50x256 pixel images in bmp format. Create your own,save them in the "ColourMaps" folder, randomise a new sky and change it using your custom color maps and keep on creating skyboxes!!!!
I hope anyone finds this useful
peace!!!
I still don't know how to post the pictures for this tutorial (I'll just post a screenshot)but as soon as I know how I promise I'll put all the tutorial pics up. Anyway, the tutorial is pretty straight forward, so let's get moving!!!
1.First of all download your copy of Skygen from:
www.logarithmic.co.uk . Remember to read his documents about using his software.
The download is pretty small. Just unzip it into any folder (i.e. Skygen) and double click on Skygen.exe (blue icon).
2.To give it a first try, just click on "randomise sky" the button on the upper right corner. Wait a bit while the program creates the box. Maximize the program so that you can see all the faces of the skybox. Now, let's try something else.
3.On the lower left corner you got a set of preset colours (or colors?). Pick any of them and then click on "change" to see how your sky changes. In my case, I'll pick black-red. Nice, huh?
4.Ok, now the exporting part. Go to file-export-bitmap files (bmp) and save the files. The program exports them in the proper order to work (left-front-right-back-top-bottom) so I recommend to name them something meaningful to you and assign them their corresponding number. In this case I named them darkred_0001, darkred_0002 and so on. We're done with skygen so now you may close it.
5.Go to the folder where you saved your images. Since TGE's skyboxes only work with Jpegs, we will need to turn them into such. I use Acdsee for this purpose, which is very versatile for simple tasks, but you may use any Image processing software. So turn them into jpegs trying to keep them in best quality. If you compress the images too much, the sky will look poor. Ready?
6. Now one last thing before going into your Torque folder.Image 0005 (top) needs to be rotated once 90 degrees counter-clockwise for it to fit seamlessly in the sybox. I don't know why this happens but if you just use it the way it comes out from skygen you will get seams. Again, for this purpose you may use Acdsee, Photoshop, Paintshop pro, etc etc etc. Just remember to rotate Image 0005 (top) 90 degrees counter clock-wise.
6-a (Addon) Rename image 0006 as 0007 since we will insert image 006 in the next step. Image 0007 will be the environment map for non textured objects in your level so what best than having your objects reflect the sky you are using.
7.Ok, now copy the images into your sample application skies folder (normally, fps\data\skies). Here you will see the default sky images (jpg), the default cloud images (png), and the default .dml scripts for the skybox to work properly.
8.Now, this step is critical. If you try to use the skybox only with the 6 images you got from skygen, the engine will crash. TGE needs 7 images for the skybox to work properly, so this is how we fix it. Copy one of TGE's sky images numbered 0006 and rename it as "yourfile"_0006. In my case: darkred_0006. This will create a full set for the skybox to work properly. This image in TGE is a small black square image, and corresponds to the ground and since we won't see it we can use any image for this but the easiest is to use image 0006 from a previous sky.
9.Now copy any of the .dml scripts in the "skies" folder and rename it as "yourfile".dml, in my case darkred.dml.
10.Using notepad, open your dml file, erase the text in it, and place the order of your jpegs. Each in one line followed by enter:
darkred_0001
darkred_0002
darkred_0003
darkred_0004
darkred_0005
darkred_0006
darkred_0007
save your .dml file.
11. And the last part. Go to your "missions" folder and locate the mission in which you want to use your skybox. Find the line that begins with: new Sky(Sky) {
and some 19 lines underneath it you will find a reference to a .dml file. Change it to your .dml file (darkred.dml). If you see a mess trying to read the script it means you must download the "Tribal ide" which is a programming text editor with some debugging and color coding capabilities (download it from the resources section).
12. And the fun part!!!Save your mission file and run your sample application. Pick the mission you inserted your skybox in and feel good! Nice, huh?
13.If you want to make it even more beautiful just add:
cloud1
at the end of your dml file, and bam! You got moving clouds. Cloud1 is the default .png file with transparency used by the sample app to simulate moving clouds. Be careful, it may not work sometimes with certain skyboxes (dunno why) making the engine crash. So if this happen, just delete the line from the dml.
14. Final ideas: in your skygen folder there's a folder called "ColourMaps" which contains all the color samples for skygen to work with. These are 50x256 pixel images in bmp format. Create your own,save them in the "ColourMaps" folder, randomise a new sky and change it using your custom color maps and keep on creating skyboxes!!!!
I hope anyone finds this useful
peace!!!
#2
holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/surrounds/
This is also the home of the Quark info, and some other very pertinent info on TGE
01/04/2003 (6:23 pm)
You can also use PNGs for the skies. First hand account :) Btw, Luc, there is a Terragen tutorial for TGE here : holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/surrounds/
This is also the home of the Quark info, and some other very pertinent info on TGE
#3
01/09/2003 (12:33 pm)
Nice tut man, Skygen is very nice thanks for pointing it in our direction :)
#5
04/13/2004 (12:15 am)
Thanks for the tutorial I was making skyboxes the old fashion way... Yes the way that leaks 97% of your memory I really appreciate you showing us this program it has saved me alot of heart ache!
#6
05/11/2004 (10:42 am)
nice man.. nice work.. will try now..
#7
thnx for the positive comments, it's a pleasure to help.
cheers!
05/11/2004 (12:11 pm)
wow, I'm glad you guys still find it usefull after all this time. I know many other resources on skyboxes have been created so I guess an update to the tutorial would be good, huh?thnx for the positive comments, it's a pleasure to help.
cheers!
#8
10/03/2004 (4:53 pm)
Ta! I don't think I've ever found such a straight forward and useful explanation of anything!
#9
=)
10/03/2004 (5:27 pm)
Thnx Alice! as I said before, and if I recall right, it's one of the first tuts I have ever written. I know it can be improved and updated much more, but it makes me very happy to know it still helps and that ppl find it useful.=)
#10
10/23/2004 (1:23 am)
The site says it is under construction, anwhere else to get skygen?
#11
It seems that it comes part of a package with the "Half-Life Tool Pack", any version of this pack should have it. Also, unfortunately, it seems as though you require Steam (part of half-life) to install it.
Here are a few links:
http://www.adrenaline.com.br/adrenaline.php?secao=news&id=5734
http://dlx.gamespot.com/pc/halflife/moreinfo_6091044.html
The gamespot link requires "free registration". Feel free to google for a few links that you'd feel better suited for your location.
Hope it helps.
- Eric
02/18/2005 (11:55 am)
Although the link seems to broken indefinately I found a few "indirect" links to get Skygen.It seems that it comes part of a package with the "Half-Life Tool Pack", any version of this pack should have it. Also, unfortunately, it seems as though you require Steam (part of half-life) to install it.
Here are a few links:
http://www.adrenaline.com.br/adrenaline.php?secao=news&id=5734
http://dlx.gamespot.com/pc/halflife/moreinfo_6091044.html
The gamespot link requires "free registration". Feel free to google for a few links that you'd feel better suited for your location.
Hope it helps.
- Eric
#12
02/18/2005 (6:21 pm)
It's great that you found those liks Eric! I'll try to find the file I got and upload it to my ftp and place a link here.
#13
08/02/2007 (12:32 am)
is there a way to control the clouds movement/direction speed?
#14
03/16/2009 (7:38 pm)
www.logarithmic.co.uk is a dead link... babsically this is useless without the software. Anyone know where its mirrord?
Torque Owner Luc Jordan
I would like to mention that anyone who is really versed in Terragen will likely be able to use that to whip up both clouds and the skybox in very short order and get much more aesthetically pleasing results, but if you know Terragen at all, you know it well enough to apply the stuff in this tutorial to Terragen -- since the big deal is mostly "how do I get it into Torque, formatted correctly etc".
Terragen is pretty simple -- you have to set the camera aperture to 90 degrees, of course, and then line up each shot at 90 degree angles -- also, knowledge of Photoshop is required to get the cloud layer properly alpha'd. I don't see the need for a seperate tutorial on Terragen, since this one covers the pertinent info well.