The following tutorial has been republished with consent:
- By Adam "Phatsniper" Owen
I've seen quite a few threads on various forums already by people who are confused as to how you create a 3D skybox. In this tutorial I'll explain both how to create the 3D skybox itself, and how to get it up and running in game.
Firstly, let's create the 3D skybox.
Load up the map you wish to add the skybox to, or if you don't have one just download mine here.
The ground outside of the ruins will later be part of the skybox, I've created this so I know how far out I want the skybox to go. I've also thrown in a spawn point for each team and a light_enviroment.
Add the point entity "sky_camera" at the coordinates 0, 0, 0 (dead center in all 3 views). This is a reference point to align the skybox to your map.
The next step seems awkward at first but after doing it a couple of times it's a breeze. You need to select some "reference" brushes (no models!) to use as a guideline for the scale and position of the skybox. For this example, select the brushes coloured red in the image by ctrl + clicking on each one. You must also add the "sky_camera" entity to the selection!
* Please Note: In more complex maps you may need to select many "landmarks" including all the outer walls of your map for the position of the skybox and some large buildings etc. for the height. What this selection process is basically doing is defining the major boundries of your map so when it comes to creating the structures in the skybox, you'll have these objects as reference to where and how large you should build. *
Your selection should look like this :
Copy then paste this selection and go to Tools > Transform. Select the Scale button and type .0625 in all 3 fields. This is the decimal value of 1/16th which is the default scale of a 3D skybox.
Your selection should now look like the above picture. The reason we scaled the brushes right down is because when the source engine renders a 3D skybox it scales everything up by 16 (which will now be the correct size for our map).
Drag these brushes outside the map. It doesn't really matter where, I just move it out and down a couple of thousand units from an edge of the map. Now go ahead and delete the original "sky_camera" entity, but make sure you keep the one inside the 3D skybox!
Now for the fun part, building the skybox! I just edited the large ground sections to make them slope up into the distance ala de_dust, but feel free to experiment!
When you're happy with the result you need to enclose the skybox inside 6 brushes (ceiling, floor and 4 walls, just like a room) and texture it with the "tools\toolsskybox" material. You must make sure there are no gaps in the outer skybox otherwise it won't work.
Now just copy and paste your light_enviroment inside the skybox and delete the reference geometry you don't need. In this case I deleted all of the walls from inside the 3D skybox, and I deleted the ground outside the ruins in the main map.
That's the 3D skybox finished! There's still a couple of steps left before we can get it running properly ingame.
Firstly, seal your map with the "tools\toolsskybox" material. This is exactly the same as creating the sky for the 3D skybox, just create walls and ceiling brushes to fully enclose the map.
Last but definately not least is changing the sky texture. Go to Map > Map Properties and click on the field "SkyBox Texture Name". You'll see that the default is "sky_wasteland02", and as of right now that can't be used with Counter-Strike : Source. You can find all the skies you can use by filtering "sky" in the texture browser and typing in the sky name. There are 6 textures for each sky, a front, back, left, right, up and down. You only need to type in the name that appears the most, in this case sky_dust.
Here's a full list of skies you can use. Type them exactly as they appear :
- cx
- de_cobble
- de_piranesi
- hav
- italy
- jungle
- office
- sky_dust
Now just compile your map and providing everything is sealed up, you now have a fully functioning 3D skybox!
Thanks for reading and good luck! Don't hesitate to contact me with any questions or comments!
Mapping - Hammer 4
Reducing Vis Times