Tarquin: okay, editorial decision is needed here, so I've taken it This page is henceforth to be:
- a definition of the term "skybox"
- technical stuff about skyboxes
- list of cool things to do with a skybox.
Building a SkyBox is now the tutorial page.
A skybox is a method of making a very nice looking sky using the Unreal Engine. It is far superior to simply plastering sky textures to the cieling of the world. A skybox creates an illusion of great distance because your movement in the level does not result in any movement of the skybox. This is only reasonable as moving from one end of a building to the other does not place you any appreciable distance closer to the sun and the clouds.
The workings of a skybox are actually quite simple internally. If any portion of a surface with Fake Backdrop set is visible, the skybox is drawn before any other drawing takes place. In other words, the skybox is drawn, then the rest of the world is drawn overtop of it. Surfaces with fake backdrop are not drawn at all, thus allowing the skybox to be "seen" "through" them. This is similar to looking through a fence - if you imagine the yard beyond drawn first and then the fence drawn overtop of it, you can still see the yard beyond through the openings and cracks in the fence. Likewise you can see the skybox "through" the fake backdrops in your level.
By default it is possible to have more than one SkyZone on a level. One of the SkyZoneInfo actors should have Advanced → bHighDetail = false, and the other set to True.
This allows level designers to build complex SkyZones for systems running in a high detail mode without inflicting the additional penalty of a complex Sky Zone on the machine running in low detail. CTF-Face uses both high and low detail Sky Zones.
A typical skybox has two sheets of clouds, both translucent. The sheets are in the top of the skybox, spaced 16 units. Both sheets have either V-Pan or U-Pan turned on in their properties. The lower sheet should have a higher texture scale than the upper sheet. This makes the "lower hanging clouds" move faster than the "background clouds".
The V-Pan or U-Pan is generally too fast to be realistic. Set the V-Pan and U-Pan values to about 0.3. You can find this in the SkyZoneInfo actor's properties, under ZoneLighting.
If you add a moon or a sun, don't forget to place it higher than the clouds and scale them down, for a distance effect. Generally placing a sun or moon texture on a sheet and having it face the skybox creates a much better looking effect than using an actual spherical mesh in the skybox, and it also generates less of a performance hit.
Coronas will not be drawn natively in a skybox. If you want one to be displayed, you will have to manually add a sheet or an actor and set a corona texture to it. You can set the corona texture directly to the light if you set it's bHidden property to false.
- Add some lights with small radii: about 12 or 16 is good. You can vary the hue of these lights to get a nice gradient along the sky. If the skybox is underlit, then add extra lights, don't increase the radius of the existing lights too much. It usually doesn't look too good.
- Set the saturation to a very low level if you want to override e.g. the blue sky texture. You can also create your own texture with another background color and add it to your MyLevel package.
- Special Lit can also be used to good effect in a Skybox, to get a more varied mix of Colors with less light actors.
Add the SkyZoneInfo in the middle of the skybox, near the floor. Create four sheets (64*128) with masked textures of mountains or city skylines around the Info (or make just one brush with the Panorama builder!). These sheets need to prevent the player from seeing the place where your cloud sheets touch the end of the skybox. You can check this by moving your camera on the place of the ZoneInfo and look around. If you can still see those edges, you can either move the SkyZoneInfo closer to the floor, move the skyline sheets closer to the Info, or make the skybox bigger.
suggestions for textures
Terrain was a pain in the past and only attempted in the skybox by a few adventurous mappers, but with the new editor(s) it's a snap. Make a skybox a little larger than standard and scale a terrain info to fit. Place the SkyZoneInfo in a 'valley' and add a Sunlight actor with the same direction as the map's sunlight actor(s). Set the appropriate surfaces as fake backdrop, rebuild and select the SkyZoneInfo again. With the camera somewhere inside your map and not in the skybox, position your SkyZoneInfo low enough in a 'valley' that the horizon is completely skybox terrain and skybox 'ceiling'. None or very little of the skybox walls should show if this is done correctly. Doing this and scaling the terrain can be tricky and frustrating, but also has the potential to produce some seriously nice looking scenery when combined with other techniques. Framerates may vary.
You can also try to incorperate movers into your skybox as maybe lightning or something, try experimenting with loop movers to create some realistic lighting by setting it to come in and out of the skybox and with a thunder sound to it. See Lightning Storm.
Your skyzone can use fog like any other zone. Note, however, that because the skyzone is generally much smaller than it looks, the fog will have to be set relatively dense to be noticeable. Note that because the skybox will be drawn on top of whatever else is visible, it can impact the performance of your level, though due to the small size of the skybox it is often not a big issue. See the Fog page for information on how to add fog to a skybox.
It's been noted that warp zones cause problems with the skybox. (I've seen this but not tried to reproduce the symptoms experimentally – Tarquin).
If both a warp portal and the skybox are visible to the player, the polys seen through the warp zone are also drawn in the sky. It may be possible (though tricky) to ensure that the warp polys are small enough so they aren't drawn in the same part of the screen as the sky polys.
I have noticed that sometimes when your fiddling with your skybox it may turn into a bsp hole where you have checked the fake backdrop off. So if that happens select all skybox brushes → order → to last (you may have to do this for each brush in your skybox individually ) and that should fix your problems after a rebuild.
Tip to me from Bot_40
This is majorly annoying in UT2003 skyboxes but I have found a nice easy solution:
1. make a cube 510x510x510 & texture it with your sky package
2. make sure the faces are the right way round (they usually get flipped in the U plane on some or all faces)
3. you might have to scale U & V depending on what size textures you use. (For example, LavaSky has 512x256 walls so you should scale these U:1 & V:2) You will have to re-rotate your textures again in a minute but its useful to know at this stage that your surfaces are all flipped correctly and the correct textures are on the correct face to save time later on.
4. VERY IMPORTANT: select all faces & do a 'box alignment' (leave the U & V scaling @ default for this type of alignment -ie 1:1)
5. rescale (if needed) and then U & V pan the surfaces if needed (& rotate also if needed –you will most likely need to do this on the ceiling & floor after panning) -everything should pan nicely into position with increments of 64 or 16.
6. admire your lovely seam-free skybox -rors
Dma: Can one skybox link to another skybox? (I know it is a strange question!)
Tarquin: you mean using the MultiSkybox actor? don't know. sounds interesting...
TaoPaiPai: It wouldn't be of too much interest unless the other skybox is animated from the first you wouldn't see the difference.
[Apoc]Famine: We had a bizarre problem with rendering skyboxes in network play. Maps and static meshes are installed on the server, and they are pushed to clients. The skyzone, level, and texture properties are the same as in working skybox levels, (antalus, etc) and they work fine in local play. However, once people connect via the server, the skybox fails to render.
This issue can be fixed by simply adding a ZoneInfo actor. Most mappers will use one as good building practice, but we've seen a few without. And, of course, to the mapper, all looks well if they don't test their map on a network.
A ZoneInfo actor must be placed in every zone you want to see your SkyBox in. (Yeah, I learned this the hard way..