WorldBuilding/Skyboxes/Skyboxes With Terragen
From TDN
Contents |
Introduction
|
Creating a good looking skybox from scratch requires a bit of image editing know-how, which is something that some people don't have. If this is the case, though, you aren't going to have to sit on the side of the skybox pool. There's still plenty of room thanks to applications like Terragen. Terragen is used to create environments for backgrounds for games and film. Terragen produces good results by itself, but often skyboxes rendered from Terragen look just like what they are: a skybox rendered by Terragen. The clouds are usually a dead giveaway. They have a distinct look to them that can sometimes work, but usually doesn't. Like any other art in your game, you want people be excited about what they're looking at without knowing how you made it; it's the difference between "That's awesome art!" and "Terragen's skies are really awesome!" The thing that makes Terragen so useful is the fact that it can create a really believable gradiant. By combining that with some of Torques other strong features, namely the cloud layers and fxSunlight, we'll create a skybox that really sings. |
Downloading and Setting Up Terragen
|
Downloading and Installing http://www.planetside.co.uk/terragen/ Go to "Download Terragen" and choose either the Windows and Mac flavor. Install it like you would anything else. Setting Up
|
Rendering a Base Skybox with Terragen Manually
|
Terragen is a very powerful tool and it is very handy in the creation of skyboxes. The first thing you'll want to do is have terragen open and click on render control. To speed up the renders uncheck the terrain render box. (Although you can have terrain in your skies.) Click on Camera Settings next and change zoom/magnification to 1. Then with that done select "Camera Orentation" Fill in the following fields after each render and you're on your way to quality skyboxes.
Front 0 0 0
Save that as a .dml and put in yourgamedirectory/data/skies/ Test it and enjoy! :) |
Rendering a Base Skybox with Terragen Using an Export Script
Another option is using a simple Terragen script that automatically exports all six sides of a Torque-ready skybox. Download the script here, or copy/paste the data below into a text file. Adjust the sun direction ("sundir"), and destination path ("initanim") in the file, save it and append the file with ".tgs". To run the script in Terragen, choose Terragen>Execute Script, and find the .tgs file you just created.
; Created by Frank Skilton, modified for Torque Developer Network by Russell Fincher.
; Original documentation: http://www.terathon.com/wiki/index.php?title=Making_a_Skybox_Using_Terragen
;
; 1. Uncheck "Fixed Height Above Surface"
; In the horizontal plane, the "z" value will be the same as the
; camera automatically (unless you override the value). However,
; we are also going to be taking pictures of the UP (and possibly
; DOWN) directions relative to the camera position so we don't want
; the target fixed.
;
; 2. Set cloud/sunlight parameters
;
; 3. To the left side of the Rendering Control window there is a
; scroll bar next to the word "Detail". Set Detail to Maximum (far
; right). Also, click on the SETTINGS button to view the RENDER
; SETTINGS window. In the QUALITY section, scroll "Atmosphere" and
; "Cloud shading" to high accuracy. In the OPTIONS section uncheck
; the "Render Lanscape" option.
;
; 4. Below the SETTINGS button is a section to control the IMAGE SIZE.
; Set the Image Size width and height to desired setting. The images
; should be square and in powers of two (i.e., 128x128, 256x256).
;
; 5. Make sure the folder listed below exists, If not, create it.
initanim "C:\Documents and Settings\All Users\Desktop\Skybox Renders", 1
; InitAnim BaseImageFileName,StartFrameNumber
; The InitAnim command tells Terragen that an animation is to be
; rendered, and initialises the appropriate variables. It is
; necessary to have this command before any calls to FRend.
;
; We don't want clouds moving for skybox renderings, but I've put
; the comments below for information---
; CloudVel is used to automatically scroll the clouds across the
; sky. It will position the clouds correctly for each frame, no
; matter what frame number the script starts at. CloudPos tells
; Terragen where the clouds would be if it were rendering frame 0.
; CloudPos x,y ;the cloud position at frame 0
; CloudVel speed, heading ;cloud scroll speed per frame
; (for entire animation)
;
; CamState xpos,ypos,zpos,head,pitch,bank,zoom,exposure
; (set zoom or exposure to a negative value to ignore)
; CamPos x,y,z
; TarPos x,y,z
; The x,y,z units are in Terragen terrain units; they could also be
; entered as meters
;
; CamOri head,pitch,bank
; CamH head
; CamP pitch
; CamB bank
;
; Zoom zoom
; The FOV (field-of-view) formula in Terragen is 2 * tan-1( 1 / zoom ).
; If zoom = 1, then the FOV is 90
;
; Exp exposure
; ShadowLight lightness (must be in the range 0 to 100)
; WaterLevel z
; SunDir head,alt
;
; FRend ;(frame render, only works after using InitAnim)
;
;
; Terragen sun headings are calculated from north (0 degrees). If the
; angle is from the east they are positive angles down the right side
; to south (+180 degrees); if the sun is bearing from the west, the
; angles are negative from north (0) to south (-180).
;
; This should give us a mid-morning sun
sundir 120,50
;_rt 1 PosX --->rotate east
Zoom 1.0
CamPos 128 128 0
TarPos 256 128 0
CamH 90
CamP 0
CamB 0
FRend
;_lf 2 NegX --->rotate west
Zoom 1.0
CamPos 128 128 0
TarPos 0 128 0
CamH -90
CamP 0
CamB 0
FRend
;_ft 3 PosY --->rotate north
Zoom 1.0
CamPos 128 128 0
TarPos 128 256 0
CamH 0
CamP 0
CamB 0
FRend
;_bk 4 NegY --->rotate south
Zoom 1.0
CamPos 128 128 0
TarPos 128 0 0
CamH 180
CamP 0
CamB 0
FRend
;_up 5 PosZ --->rotate to south and pitch up
Zoom 1.0
CamPos 128 128 0
TarPos 128 128 128
CamH 180
CamP 90
CamB 0
FRend
;_dn 6 NegZ --->rotate to north and pitch down
Zoom 1.0
CamPos 128 128 0
TarPos 128 128 -128
CamH 0
CamP -90
CamB 0
FRend
; Post-processing
; Convert files to Torque-ready format, rename,
; and move to appropriate folder.
The resulting files will need to be converted to a Torque-ready format, re-named, and placed in the appropriate file path for your project. Original documentation here. Thanks to Frank Skilton for providing the script.
Creating the Cloud Layers
|
words |
Tweaking fxSunlight
|
words |
Troubleshooting
|
words |



