This is an example of a 3D skybox- it’s a minature-scale model that Source makes look
a lot bigger and shows wherever the skybox texture is in your map.
All you need is the sky_camera entity.
You place an entity in the level like so, click on the selection tool and double-click
on the entity.
Choose sky_camera from the drop-down list.
It then puts everything that it can see around it in the 3D skybox.
Of course, you don’t want the miniature model in your level.
There’s an easy solution- move it to somewhere that the players can’t access.
In this case, I have made a separate skybox for it.
As you can see, it looks the same as before, only without the miniature version within
the middle of the level.
Source is very clever- it’s even calculated the shadows across the level from the models
within the skybox.
To line it up you could always just guess the position and playtest until you get it
right.
But here’s the professional way: The position of the sky_camera entity reflects the 0,0,0
point in Hammer (The point where the blue lines in Hammer meet each other).
The sky_camera’s default scale is 16, which means that things in the 3D skybox will look
16 times larger than they really are.
Say you have this block in your level and you want it to extend into the skybox.
Firstly, make the same block only 16 times smaller in all dimensions.
Since the original block’s bottom left corner is CONVENIENTLY at the 0,0,0 point in Hammer,
making the skyboxes version touch the sky_camera entity means that they are now in identical
positions if you were to load up the game.
But we don’t want identical positions.
Moving the block along to HERE means that it will now look as though the wall is continuing
on, past the edge of the level.
And... that’s about all there is to it.
Let’s load up the game and see what it looks like.
As you can see, it looks as though the block extends into the skybox.
However, the textures don’t match up.
This is because the textures are currently 16 times too large in the skybox.
Lining up the textures just requires some common sense and simple math.
Textures are by default at a 0.25 scale.
You would have to get a figure 16 times smaller than this to line it up properly.
It’s possible to do, but a simpler method is to make the textures in the level 0.32,
meaning that you can set the texture scale in the skybox to 0.02 and it will match up
perfectly.
This is fine for most textures, though you’ll have to check with windows as they may end
up looking wrong unless messed around with first.
Be sure to also check the texture shift values as these may cause the textures to not align
properly.
The other thing to adjust is the lightmap scale- or how much shadow detail is calculated.
You will have to make the lightmap scale in the skybox 16 times smaller for it to match
up- if it doesn’t then one part may appear brighter than the other for no apparent reason.
You have to be careful with this- your map size will expand enormously if you do this
over a large area, and you’ll get errors and graphical glitches if it ends up calculating
too much information for a single block.
Only change this value if you really have to, and prepare to revert to an earlier map
file should anything go wrong.
Even with all of these adjustments, the results aren’t always perfect- the changes here
I believe are due to the ambient lighting value- you can either ignore the change in
brightness, or cover up the join in some way as I have here.
In practice, the jump to the skybox should be beyond where the player can explore anyway,
so this shouldn’t be a problem.
You can adjust the skybox scale by changing this value.
Be aware that this will adjust the distances and sizes calculated previously in the tutorial.
You can enable the fog by using this option- if you want seamless fog with the fog already
in your actual level, set these three properties to the same as the env_fog_controller in your
level- if you have one, that is.
Hopefully this video has cleared up what the 3D skybox does.
Have fun.