Documentation‎ > ‎User Guide‎ > ‎

Creating Skyboxes

Creating Custom Skybox Sets


You will need to the Terragen scenery generator for Windows or the Mac OS. Terragen is free for personal non-commercial use. Seehttp://www.planetside.co.uk/terragen/

The present Cobalt skybox requires five images to be rendered. The following script will automate the creation of six (including a bottom texture that is not required). This way you do not have to repeatedly come back to your computer and readjust the camera after each render.

Prepare a Script

Use a text editor to save the following script as skyboxscript.tgs. Alternatively, you can simply download the one attached to this page and use it. It can be saved anywhere.


initanim "C:\skyrender", 1

;_ft
Zoom 1.0
CamH 0
CamP 0
CamB 0
frend

;_lf
Zoom 1.0
CamH 90
CamP 0
CamB 0
frend

;_up
Zoom 1.0
CamH 270
CamP 90
CamB 0
frend

;_bk
Zoom 1.0
CamH 180
CamP 0
CamB 0
frend

;_rt
Zoom 1.0
CamH 270
CamP 0
CamB 0
frend

;_dn
Zoom 1.0
CamH 270
CamP -90
CamB 0
frend


Render the skybox

Now, in Terragen, uncheck both of the Fixed Height Above Surface boxes in the Rendering Control window. Place your Terragen camera where you want the viewpoint of the skybox to be. What's important here is the Camera Position. The Camera Orientation doesn't matter. Note that changing the height can affect the appearance of the clouds even though the horizon is always in the same location.

Set the detail all the way up in the Rendering Control window. Set the width and height both to 484.

You should double check that you did the first two steps right so you don't waste a lot of time. Now, choose Execute Script... from the Terragen menu, and choose the file skyboxscript.tgs that you created earlier. Now the rendering will commence. It may take a while.

When the rendering is complete, a dialog will pop up saying the script is complete. Quit Terragen.

Preparing skybox textures

1. Resize the files

Now, if you open up the C: drive (or desktop folder on a Mac), you'll see six new files. Because of the particular way that skyboxes are presently created in Open Cobalt, you will need to resize them to 484x484 pixels using an image editing software package (Photoshop is best) and then save them out as BMPs.

2. Rotate the 'Above' texture

Please note that you will also then need to rotate the 'skyrender0003.bmp' file counterclockwise by 90 degrees to that it aligns correctly with the other skybox textures.

3. Add a 14 pixel border

You will then need to copy each texture and paste it into a BMP texture file of 512x512 pixels (a template that you can use for thus is located in the content>textures>sky>box directory). The pasted image should be centered on the 512x512 background. This will create the necessary 14 pixel wide borders around each of your texture files. After this you should save the bordered 512x512 pixel file as a BMP.

4. Rename the files

Now be sure to name the files as follows:

Original filename Change to
skyrender0001.bmp North.bmp
skyrender0002.bmp East.bmp
skyrender0003.bmp Above.bmp
skyrender0004.bmp South.bmp
skyrender0005.bmp West.bmp
skyrender0006.bmp Below.bmp

Load skybox textures

Now you will need to place all the files into a folder and add that folder to the content>textures>sky>box directory. Now you can choose the newly created skybox texture set using the Space Info Panel accessible from Open Cobalt Space>Space Info... menu selection.

Comments