Tutorial: Custom Skyboxes for Goldsource Last edited 1 year ago2022-09-01 11:18:29 UTC

Download attachment

Custom skyboxes can add a touch of uniqueness to a finished map, changing the setting from the stock New Mexican deserts and Xenian Nebulae. If you're interested in creating skyboxes, you'll need Terragen first. Install it, and download the example map to get a compiling script for the skyboxes.
The default Terragen Interface with nothing opened.The default Terragen Interface with nothing opened.
When you first open Terragen, the interface may be confusing. To get started, click Generate Terrain.

In the dialogue that opens up, choose the settings for your blank slate. When you're happy with what you've selected, click the Generate Terrain on the window. The Landscape window will now display a hightmap image of the terrain you currently have. Most likely, you'll want to change it, so open it up and work with the sculpting tool until you're happy with what you have.
With either display mode, the heightmap will change colour when you edit it.With either display mode, the heightmap will change colour when you edit it.
Afterwords, change the atmosphere, sun, water, and cloud settings to your liking. You may also wish to change the surface map, so the terrain doesn't look like a bland rock surface when it's rendered. It takes skill and experience to create realistic terrain, but it's fairly easy to play with water reflectivity, sun position and environmental settings to create something that looks good.
Once you think the terrain is good, change the camera position to the centre of the terrain with the camera tool in View/Sculpt, and turn its facing to a side of the viewport. You can adjust the height and angles as well, but it is recommended that the target height be the same as the camera height, so the skybox appears level ingame.
The camera should have settings similar to this.The camera should have settings similar to this.
You may want to save before going any further, just in case you're not happy with the images or they are renamed incorrectly later.
Jack up the detail in the Rendering Control window, and go into the settings to do the same with the Quality tab's accuracy sliders. Also of importance while the window is up is the Image tab- make sure the image is set to be 256x256.
For best results, make sure all the detail options are full.For best results, make sure all the detail options are full.
In the top toolbar, go into Terragen and select Execute script. locate the skycreate.tgs script found in the example download, and run it. Terragen will begin rendering 6 images with facings based off the camera's original view. Once it reaches the end, you no longer need Terragen open.
The render viewport will start black and reveal more of the enviroment as it is rendered.The render viewport will start black and reveal more of the enviroment as it is rendered.
Go into your C: drive, where the script will have spat out 6 bmp files. Rename the images according to the following key, where xxx is the skybox name you want to use; (Note: The underscore is not needed, and only in for clarity's sake. If you use it, be sure to make sure your skyname in the editor is xxx_, not xxx)
Original FilenameWhat to rename it to
0001xxx_rt
0002xxx_ft
0003xxx_lf
0004xxx_bk
0005xxx_up
0006xxx_dn
If needed, touch up the images, getting rid of any black areas in the terrain's borders. Using your favourite TGA compatible image editing program, save all of these renamed images as .TGAs, and place them in the gfx/env/ folder of the mod or game you want to use them in. Edit the RMF included in the download to use your new sky, and compile it. If the renaming process was done properly, all sides of the skybox should fit together seamlessly, and run perfectly in game.

Author's Note: This tutorial does not work with the more recent Terragen 2, as it is not currently capable of executing Terragen script files.

7 Comments

Commented 13 years ago2010-05-31 07:42:20 UTC Comment #100923
haha awesome. much easier using terragen than i thought it would be! great job..

)

Commented 13 years ago2010-06-08 12:32:22 UTC Comment #100924
Very helpful, thanks JeffMOD. What if you wanted to make an urban setting, with faraway buildings in the skymap instead of mountains. What would be the best way to do that?
Commented 13 years ago2010-06-22 15:15:31 UTC Comment #100925
Uh... Modeling software, I guess. Terragen isn't capable of doing buildings on it's own, and it doesn't have an importer for models.

You may be able to do it with imported heightmaps and a complex set of ground textures, but that's beyond the scope of this tutorial and my skill in Terragen.
Commented 13 years ago2010-06-23 19:04:48 UTC Comment #100926
Thanks anyway JeffMOD. It seems Terragen 2 can do so much more, what a shame the script doesn't work with it! I have found a workaround of sorts; Load a near empty map into HL with just just distant geometry you need, and set the screen resolution to 320x240. It's close enough that I was able (with a little bit of photoshop skill) to blend screenshots of the geometry in with the skymaps. Not ideal but it'll do me for now.
Commented 13 years ago2010-08-02 08:59:53 UTC Comment #100927
I've never used Terragen 2 myself, but it should still work. In Terragen 1 it's possible to position the camera without scripts, I didn't even know scripts existed until I read the tutorial. It would likely be possible to do in Terragen 2. Just set the zoom to 1.0, and set the camera orientation yourself.
Anyway, it's a good tutorial Jeff. Very handy.
Commented 4 years ago2020-03-12 23:29:59 UTC Comment #102579
I doubt I'll receive an answer on a tutorial posted 10 years ago, but I've received an error message, while executing the script.

(Terragen error)
: Unable to open file!
: Possible causes: folder doesn't exist or disk full.
: Check output settings for the script.

(Terragen error)
:Unknown image format or error writing file.

(Terragen)
:Animation render aborted.

(Terragen)
:End of script
User posted image
User posted image
User posted image
User posted image
Commented 2 years ago2021-12-28 19:41:40 UTC Comment #103910
Me: When you have a custom GoldSrc skybox, is there any reason to include BMP files? Are they used anymore? Or just the TGAs?
Admer: Yeah, software mode I think
func_cambreaKable: software mode uses tga's too though
func_cambreaKable: i have only tga skyboxes in WAR and they work on software mode
Mikko: software mode falls back to tgas if bmps can't be found
Mikko: bmps can be used by gl too if you have an old graphics card that supports those paletted texture extensions

You must log in to post a comment. You can login or register a new account.