DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

Tutorial: Picture Perfect Skies with Hawk

Modding questions, answers, help.....

Moderators: Warfare, Admin, Moderator

Post Reply
Triv
Veteran Member
Veteran Member
Posts: 159
Joined: Mon Jan 22, 2007 6:32 pm
Contact:

Tutorial: Picture Perfect Skies with Hawk

Post by Triv »

PICTURE PERFECT SKIES WITH HAWK!

*****DOWNLOAD***** A needed plugin for Terragen
http://rapidshare.com/files/232928185/P ... _Skies.zip

Being a bird, there is nothing I hate more then flying around in a crappy looking digital sky hidden by lots and lots of clouds and fog. In this tutorial, you will learn how to make picture perfect skies that will allow you to turn off the clouds and the fog!

First a brief personal note. I've worked with many other types of gaming systems other then Torque. All of their communities are very helpful and supportive... except for the Torque community. The general Torque attitude is "Go figure it out for yourself" and some of them can be quite rude about it. Not just me, but others have commented that it seems like the more experienced users of Torque like nothing more to do then come on the forums and make fun of the newbies and their "stupid" questions. This "I'm better then you." attitude needs to stop! There are no stupid questions when you are first learning. What you people don't realize is these newbies will eventually learn how to use Torque, and when they do and invent something really cool... THEY WON'T SHARE IT WITH YOU! You think they are going to share it with people who kicked them around on the forums? Keep that in mind when you berate someone for reporting what they thought was a bug. People like me.

I've been wanting to release some sort of tutorial to give back to those helpful members of the community, so this will be my first. I'm going to release one of the most best kept secrets in gaming development. How to generate picture perfect sky boxes.

There are two types of methods for making a sky. A sky sphere and a sky box. The sky box is the most common. A sky box is literally a huge giant box that you are inside of while in the game. Pictures are then pasted on all 6 sides of the box and that is what you see as you are walking around inside the game. As you walk around, the sky box follows you, so you can never reach the end of the box.


ORIENTATION
In the Torque directory of "????/data/skies" you will find some JPegs called "day_0001.jpg" to "day_0007.jpg". Go ahead and open them up and look at them. Notice there is always a black circle at the bottom? By the time you are done with this tutorial, you will know why!

As you know or will soon find out, compared to all the other industry standard gaming engines on the market, the Torque engine is very, very buggy. It's also one of the most powerful, so don't get me wrong. One of the bugs is that it requires all 7 files. If it doesn't find the files, it will crash and burn so be SURE you use all 7 files.

Since there are 6 sides to a cube, you will be using 6 pictures per side. Since Torque generates its own ground, you won't even need the 6th file, so really you are working with only 5 files. The files break down as follows:

1 is South (Azimuth 180)
2 is East (Azimuth 90)
3 is North (Azimuth 0)
4 is West (Azimuth 270)
5 is Up (the top, Elevation 90)
6 is Down (the bottom, Elevation -90) and is not used unless you click "renderBottomTexture in Sky ->Misc" in the Mission Editor F11.
7 is Environment map (the picture you see when an object is reflecting the sky itself. Kinda like a picture of the entire skybox looking up). Thanks LDAsh for the clarification!

These pictures are pasted on the skybox from the outside wrapping around, then top, then bottom. The top of the "UP" picture will face to the South. Since you are inside the cube and the pictures are placed on the outside of the cube, you are actually looking at the back side or mirror image of the picture.

In the same directory you will find the file "sky_day.dml". This is a material list file and in it you will see the following files mentioned:

day_0001 South
day_0002 East
day_0003 North
day_0004 West
day_0005 Top
day_0006 Not really used if you are using terrain.
day_0007 Environment Map (picture of all the top and sides of the skybox)
cloud1 Clouds on layer 1
cloud1 Clouds on layer 2

A note about clouds. Clouds are black and white "alpha channel" pictures. This simply means, what is Black in the picture you can see through, what is White in the picture, you cannot see through. These pictures are placed into tiles as though you were up above, outside the cube looking down on the cloud plane.

That should get you focused on what we are dealing with, now lets get started making some sky!!


GETTING STARTED

First download Terragen. It's free for private use, so put a way the credit card for now. http://www.planetside.co.uk/terragen/

Terragen is the Industry standard for photo realistic generation of skies, water and landscape. It is so powerful that Paramount Pictures used its technology in the Star Trek Episode "Nemesis". In fact, they will be using it to generate most of the planets and landscapes in their upcoming productions!

Straight out of the box it's pretty much ready to go. We just want to set a few options:
1. Since you are using the free version, you can't increase the resolution above the defaults, so lower the resolution slightly to the next round figure which would be 512 x 512. To do this, Click "Render Settings" and then set "640 480" to "512 512".
2. Next, increase the resolution to maximum. Move the detail slider all the way to the right.
3. Finally, DE-check "Land" since you will not be using it. It speeds up rendering time. (Now you know what the black half circle is!)


GENERATING THE SKYBOX PICTURES

Now you are already to make some sky! But how? Now that is the difficult part, but luckily Terragen supports a scripting language! I've done all the work for you! Simply use the included skybox generation script. To use this file, click "Terragen" -> "Execute Script" -> then choose "HawkGenSky.tgs".

Now sit back and relax as a new skybox is generated as you wait!

Done? Good, now in the directory that you executed the script"HawkGenSky.tgs" from. You will find 7 files numbered "sky0001.bmp" to "sky0007.bmp", those are the files that Terragen just made! (And now you know why the demo files are named "sky0001", etc. and not "sky1, sky2, etc" and what that half black round circle is!)

I would recommend leaving the pictures as is in their native BMP format, do NOT convert them to Jpeg format! Although Jpeg compresses smaller, you will also get "artifacts" added to the picture. "Artifact" is the name given to the salt and pepper type "noise" that makes a picture look grainy.

The only thing left to do now is copy the pictures over to the skies directory and change the name in the materials list.

FINAL NOTES
1. "noRenderBans" turns off distant fogging. I would leave it on because its used in conjunction with distance fogging and it covers up the black half circle. However, if you turn off all fogging and turn on "land" in Terragen, then you definitely want to turn this off too.
2. Torque (and other game engines) does not use a standard (according to Terragen's standard) azimuth and elevation system. The deviation between the two are:

Terragen AZIMUTH =(Torque Azimuth +270)
Terragen ELEVATION =(Torque Elevation +10)

For example. The default sun location in Torque is Azimuth 45, Elevation 35. (To change this, enter the game, press F11, click open "MissionGroup" and click open "Sun" and click the "MISC" button.) So to get Terragen to align it's sun with Torque, we have to change it to Azimuth 315, Elevation 45

3. You can click "useSkyTextures" on or off to remove the pictures, but leave the default color on the skybox.

*IMPORTANT!* Keep in mind that Torque does not check up on you like other gaming engines do. Make sure that if you specify a file, that you HAVE the file present or remove all references to it. Torque will NOT warn you! It will just simply crash! So if you do not have clouds listed in the material file, yet you have values assigned to them in the mission file... Crash! Yaa for buggy software.

PS. I recommend you to change all the pictures into jpeg format which make the pictures size smaller and that makes it to faster to download.
Last edited by Triv on Fri May 15, 2009 8:47 am, edited 1 time in total.
User avatar
Metal
Need Major Repair
Need Major Repair
Posts: 1278
Joined: Fri Dec 26, 2008 5:48 pm

Re: Tutorial: Picture Perfect Skies with Hawk

Post by Metal »

I still don't get it... but is really cool I think... I tried it but :oops:
Your website has got really good maps... as most Desert Oasis, I'll try this again to get it work
Thank you!
Post Reply