Making a Skybox in TG2 with Garasaki

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Making a Skybox in TG2 with Garasaki

Postby Garasaki » Wed Jun 30, 2010 5:23 pm

These tutorial is intended to instruct you on how to create a custom skybox for your track using TG2. This tutorial assumes you know or can find out how to create a scene within TG2. This tutorial only covers using the camera’s and renderers included in the template file to create the skybox. We will use a program called “Hugin” to stitch our final panorama together.

Go download TG2 http://www.planetside.co.uk/content/view/21/36/

Open TG2, and open the template file included below

http://www.mediafire.com/?gwgniou1ixn

On the right side, you’ll see the preview window, it’s probably all dark (well gray). It currently has the lighting and clouds turned off. Turn them on by clicking the buttons on the top left corner of the preview window area – the cloud looking button and the sun looking button.

Now you should be able to see a preview of the sky. It’ll look strange at first, because of the way TG2 renders it. As the percentage complete (upper right corner) increases, it’ll look more and more like a sky.

Ok lets start by decreasing render time. Click on atmosphere, then atmosphere 01 (upper left corner window). Go to the “quality” tab, and turn the quality way down. Do the same for altocumulus 01. We’ll dial these numbers back up for our final rendering. But for previews, you don’t need them so high.

Let me start by explaining the final rendering process. If you click on “Cameras” at the top, you’ll see a long list of cameras – North, South, A1, A2, B1, B2, etc. The directional camera’s (east, west, etc) are useful for doing quick preview renders. They will show a 90* FOV of the sky. The camera’s you will use for your final renders are A1, B2, C1, etc. The only camera’s that are truly necessary are A1-8, B1-8, and C1 and C2. The other cameras may be useful in stitching together your final sky.

How do you use a camera? Well, you can use it in the preview window. In the lower left corner of the preview window there is a button “select different view cameras”. Pretty straight forward right? Just pick a different camera to see a different preview of your scene.

You can also click on the “Renderers” tab. You will see 3 renderers already set up for you. I use “Full Preview”, along with a directional camera, for a quick preview rather then using the preview window. To do this, click on the “Full Preview” renderer, select your camera, and hit render image.

Final rendering is done with the” Final Render” renderer. What we are going to do is render a minimum (20) 800x600 images. For each render, you will have to manually change the camera from A1 to A2 etc etc until you’ve rendered all of A1-8, B1-8, and C1 and C2. (you should be able to skip the BC camera’s too). I have had the best luck saving these final renders as .bmp files. They each take 15 minutes to an hour (or more) depending on your computer. So yes, it will take a long while.

Make sure you increase the quality level of your clouds and atmosphere before you do final rendering.

But Garasaki, why in the world do we need these 20 images??? Well TG2 restricts the free version to a maximum image size of 800 wide by 600 tall. So if you just did east, west, north, south, and up, you’d end up with 600x600 pixel images. Its my opinion that the game requires images of 1024x1024 to make a decent looking sky. So in order to accomplish this, we are going to render small snapshots of the sky and stitch them together. Each of the images these camera’s render is a small shot which actually duplicates some of the information of the other shots – this helps stitch them together later.

It’s useful to understand how the images are arranged. All the A images are next to each other, with some overlap, all the B images are next to each other with some overlap, the B images sit on top of the A images with some overlap, and the C images are pictures looking straight up, with some MIRRORED overlap in the middle. These should also overlap the B images. For instance, if you put A1 (on the left) next to A2 (on the right), you’ll notice the images duplicate a vertical column of information in the middle. If you put B1 on top of A1, you’ll notice the images share a horizontal column of information in the middle.

So basically, the A images are a 360 strip of your sky, at the bottom, the B images are a 360 degree strip, closer to the “top” of your sky, and the C images fill in the blanks at the very top.

Making changes to the cameras and renderers I have setup have the potential to ruin the entire thing - mess with these at your own peril.

We will stitch these 20 images together using “hugin”. Get it here http://hugin.sourceforge.net/

I was never able to get the current version to work so I use a legacy version, 0.7, available here

http://sourceforge.net/projects/hugin/f ... e/download

Hugin, hypothetically, is simple. You just add your 20 or so images, tell hugin your camera’s FOV was 60, and then hit “align images”.

Best case scenario is that hugin is able to align your images perfectly, then you simply export your panorama. You will know you are this point when hugin pops up a panorama preview, you inspect it, and it looks 100% complete. Then close down the preview window, and click on the last tab (“stitcher”). Then click “calculate optimal size” for your Panorama Canvas size. Then choose the file formats you want and click “stitch now”. Name your file, let hugin do it’s thing, and you will have a completed skydome.

Worst case scenario with hugin is that, when you try to align your images, hugin will tell you it couldn’t align them automatically. This happens when your color variations are slight and subtle or you have large expanses of the same color. At this point you have 3 options:

    Try rendering the BC cameras and or the C3, C4 cameras, and adding those images to hugin to add some new control points. I’ve not had much luck with this.

    Manually input your control points between different images/groups of images. This will make your head spin the first time you do it – but if you understand how the images are linked its not so hard.

    Start over and change your scene to include more contrasty colors.

Once you have your panorama stitched, you need to resize the image to 4096x2048 pixels. You can also add stuff here if you wanted to (like a horizon image), or adjust colors.

At this point, you can use JLV’s skydome batch file to create the skybox images the game uses.

http://mxsimulator.com/benchracing3/vie ... f=2&t=2868

You will also want to use some of the techniques DJ outlines here

viewtopic.php?f=11&t=1916

to create a lighting file that matches your new sky.
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Wed Jun 30, 2010 5:33 pm

So I wanted to keep the first post clean, only outlining the process. Here are some random tips:

You really only need to concern yourself with the "Atmosphere" and "Lighting" tabs. Everything that affects your sky can be done here.

You can make a nice sky with the cirrus 2d clouds. Rendering 3d clouds takes a long time, so don't get too hung up on having to use a lot of 3d clouds.

I like to use a top layer of 2d cirrus clouds with a lower layer of 3d clouds.

TG2 takes into account all your different cloud layers when doing lighting calculations. Therefore, you COULD disable 1 cloud layer while you try to tweak another, but when you enable that first cloud layer, your results are going to be entirely different. Same thing with atmosphere. In some cases, it may make sense to disable certain things in order to quickly tweak something to your liking - but remember the final results will vary.

The Ambient color of clouds is sort of like the reflection from the ground - its the "bottom" color of the clouds. This has a signifigant impact on how the clouds look.

The "pattern" dialogue box, accessed right under the list of cloud layers, controls much of the cloud formation appearance for the selected layer of clouds. This isn't really an intuitive place for this control IMO, so don't overlook it. The smallest scale slider in this dialogue box identifies the smallest features on a cloud that will be rendered and dosent actually affect the size of cloud formations (as far as I can figure). This also dosen't seem intuitive. Control the size of your cloud formations with lead-in scale and feature scale.

Denser clouds look more like rain is coming.

Cloud depth and coverage adjust make surpringly big impacts on the overall scene.

Some clever people are putting the disp map of there track in as terrain to get a really seemless transition between terrain and sky, in game. Seems like an awesome idea!
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Wed Jun 30, 2010 5:44 pm

Think a lot of people have been waiting for this :). Awesome tutorial Gary, looking at the skies/lighting you have done with this process you can definitely do some real looking environments. Does anything from DJ's tutorial besides making the lighting file (and environment mapping image) carry over to this? I'm assuming your other sky tutorial has absolutely nothing to relate to this one?
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Wed Jun 30, 2010 6:10 pm

The only thing you need from DJ's tutorial is fog color, sun vector, sun flare vector, and you can use some of the same ideas for sun and ambient lighting.

The end steps on my old tutorial still apply, but I added them here too. JLV's script is really really nice since it sets up all the files correctly.

After MX Jones is released, I'll also release all the TG2 sky files I've developed so far.
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Wed Jun 30, 2010 6:11 pm

PS JLV's script makes the enviroment mapping image too
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Wed Jun 30, 2010 6:16 pm

Ok, thanks man :).
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Tue Jul 13, 2010 6:43 am

What did you do to figure out where the sun heading is for the lighting file? Terragen has that little image, but Terragen 2 has nothing like that. Can you find out by just knowing the number?
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Wed Jul 14, 2010 3:34 am

The sun heading and angle is defined under the lighting tab when you click on the sunlight_01 "layer"
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Thu Jul 15, 2010 12:28 pm

Here are all the TG2 files I've ever created.

I'm not promising any or all of them are good, useful, or make any sense at all. But if you wanna look at/use em:

http://www.mediafire.com/?sharekey=0651 ... b903f4652b
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Fri Jul 16, 2010 1:38 pm

Thanks man, helped looking at them and see what you did to make the look :).

I found out you can still get TG1 off of their website (the demo anyway). So with that I just enter the sun heading number from the sky TG2 so I can use that little chart with the red line in it to do the lighting file :).

I started up 9 TG2's last night and rendered A8-B8, 9 at one time. They took about 1 hour and 40ish minutes. I'm just glad it didn't crash :lol:.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Fri Jul 16, 2010 1:43 pm

I take that back, a few of them say they took over 3 hours. The names of the renders doesn't matter for stitching when they are in Hugin right?
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Fri Jul 16, 2010 1:57 pm

no the names don't matter.

It would be a lot easier if you could run a script or batch file with the process, right :roll:

Sort of a dumb move on planetside's part IMO - people aren't gonna pay 300 bucks just for the ability to script it, but they will go get a pirated version......
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

User avatar
yzmxer608
Posts: 15229
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: Making a Skybox in TG2 with Garasaki

Postby yzmxer608 » Fri Jul 16, 2010 2:08 pm

Yeah, I was thinking the same thing. It's such a pain to have to start and save 18ish renders :(.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: Making a Skybox in TG2 with Garasaki

Postby Garasaki » Mon Nov 15, 2010 3:25 pm

Here are the sky files I used to create the skies in Blackhawk Hollow

Storm remnants - http://www.mediafire.com/?5k1x6banjy2dczg

Image

Hot and Humid - http://www.mediafire.com/?5k1x6banjy2dczg

Image
Image

DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.

rafagas
Posts: 381
Joined: Sat Dec 31, 2011 12:53 pm
Location: Barcelona, Spain

Re: Making a Skybox in TG2 with Garasaki

Postby rafagas » Sat Apr 21, 2012 4:44 pm

Garasaki wrote:Open TG2, and open the template file included below

http://www.mediafire.com/?gwgniou1ixn




Can someone reupload this template please?
Image


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest