Many of you will have seen the large landscapes beyond the walls in the dust maps. We will be looking at the method used to implement terrain in a 3D skybox. The method is the same for anything you place in one.
The first thing to do is to have some land that the player will walk around in, be advised that no entities such as players can move into a 3D skybox, they are for show only but allow your maps to appear much larger then they really are.
I have created a small grassy area with a low surrounding wall for this example; I have then added a skybox around this area, it is important to remember that the 3D skybox will surround this area seamlessly.
Next we need to add a sky_camera entity to the map, it needs to be dead centre of the grid, 0,0,0 on every plane. You can align it with the blue lines on the grid and also the small aid in the 3D view. This will tell the engine where the level will be in relation to the 3D skybox.
The way a 3D skybox works is that anything that is to be rendered in there is scaled to 16 times it’s original size, this saves on memory when in game and allows vast environments to be made, further then the normal grid. The things we want rendered in the box have to be made at 1/16 in the editor, and then they are scaled up in game.
To help us with this we need some reference objects from the level so we know where to build the 3D skybox, this would usually be the surrounding parts of the level, and so in this case I will be selecting the outer wall and the grass. Make sure you also select the sky_camera entity along with your reference objects. This will only be as a guide so first of all Copy & Paste the selected objects anywhere.
Then we need to scale this down to 1/16 of it’s size, to do this go to Tools-> Transform and make sure the Scale button is ticked. Then with everything still selected type .0625 into each field. This will scale it down to 1/16.
Now move the small reference objects over somewhere out of the way so we have some room to build the landscape around it.
I will be making some hills to go in the 3D skybox so I created some brushes around the outer wall and textured them with the grass texture. This is why we pick some reference materials from the playable portion of the map, it helps to judge the size and scale of objects in the 3D skybox, in this case the landscape.
I then used the displacement tool to start building the hills, you can have flat ground if you want with buildings, you don’t need hilly areas. But I decided on that for this example. To make the displacement easier to use make sure you lower the Distance bar and Radius bar down to 1. This makes everything small and easy to use for such tiny geometry.
Once you have finished creating you landscapes, or buildings or whatever, remember to delete the reference geometry and also the sky_camera from the main level. You should be left with the shrunken geometry and the sky_camera. Also place a hollowed box around the geometry with the SKY texture on every face.
The 3D skybox and main level are lit separately, so be sure to copy your light_env in here as well.
Finally, you should know that models cannot be scaled, so you will find some models that are very small and have skybox in their name usually. If you place these in the skybox they will also be scaled up in game.
There we go