3D Skybox

Tutorial collection, comprehensive listings on main site.

3D Skybox

Postby Tutorial on Mon Mar 07, 2005 11:30 pm

category
General Half-Life 2/Architecture

description
Construct a detailed surrounding area to your maps, outside of the playable area.

keywords
3d, sky, box, skybox.

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.

Image

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.

Image

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.

Image

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.

Image

Now move the small reference objects over somewhere out of the way so we have some room to build the landscape around it.

Image

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.

Image

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.

Image

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.

Image

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

Image

Related:
Example Map

Blink
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby RaccoonKing on Thu May 19, 2005 2:14 am

I read through twice and I'm still thoroughly confused, I'm sorry to say. Sorry because it's not working for me, but also sorry because your other tuts have been great.

I built (in HL:DM, not CS:S if that makes it not work?) an empty map sealed completely in skyboxes (with a spawn of course).

Made a sky_camera, inside of another single skybox, outside of my primary world (the sealed area).

Built some junk around the sky_camera, inside the second skybox.

None of the junk shows up when I run the map.

I downloaded your map, and the landmass around the sky_camera renders, but it looks like there's no cubemap (probably because the textures are for CS:S, so I deleted the t-spawn, changed the textures and that fixed that.

However, the skybox texture (the actual sky, behind the 3D stuff) doesn't render in your map, and I can't make it do so. (it does that "hall of mirrors" effect.)

If anyone's reading this and knows the answer, could you help please?

Thanks.

--RK
RaccoonKing
Been Here A While
Been Here A While
 
Joined: Wed May 18, 2005 2:15 pm

Postby CrapinaBottle on Thu May 19, 2005 2:18 am

You now you're supposed to create a sky_camera on the origin of the map right (0, 0, 0)?
CrapinaBottle
Regular
Regular
 
Joined: Sun Apr 17, 2005 4:41 am

Postby RaccoonKing on Thu May 19, 2005 2:24 am

I'm not exactly sure what you mean, that it needs to 'spawn' there when you first click create, or that it needs to reside there while compiling? (Or something I missed completely?)

I'm unsure how to gauge it that precisely, but when I downloaded the finished map, it seemed like the sky_camera was offset.

Sorry about this, I started seriously learning Hammer yesterday or so.
RaccoonKing
Been Here A While
Been Here A While
 
Joined: Wed May 18, 2005 2:15 pm

Postby CrapinaBottle on Thu May 19, 2005 2:32 am

Okay... errrrr.....
This is how I do it:
1) Don't create the map in the center of the map.
2) Create sky_camera in the center of the map (On the green line both height and width and stuff).
3) Create prop_static(s) around the skycamera with the prop_buildings props.
4) Maker sure the see through part of building is facing the other way, don't make it face the sky_camera
5) cover it in skybox, don't just make a skybox texture hollow, just surround it with the skybox.
6) Compile and run.
CrapinaBottle
Regular
Regular
 
Joined: Sun Apr 17, 2005 4:41 am

Postby RaccoonKing on Thu May 19, 2005 2:46 am

So... you build the map where it's not supposed to be, and build the sky_camera where the map's anchor point is supposed to be.

That's quite possibly the screwiest idea I've ever heard.



Thanks a ton for the help, Bottle. I can imagine how long that would have taken me on my own.
RaccoonKing
Been Here A While
Been Here A While
 
Joined: Wed May 18, 2005 2:15 pm

Postby CrapinaBottle on Thu May 19, 2005 2:52 am

so........ did it work?
CrapinaBottle
Regular
Regular
 
Joined: Sun Apr 17, 2005 4:41 am

Postby RaccoonKing on Thu May 19, 2005 3:22 am

Yes.
RaccoonKing
Been Here A While
Been Here A While
 
Joined: Wed May 18, 2005 2:15 pm

Postby Grim Reaper on Thu May 19, 2005 6:39 am

I dont see why you just put in a river or something, create hills and stuff behind it and then put in a player clip. Much eaiser.
Mapper
jman wrote:Blocky, yet good.

Image
Grim Reaper
May Contain Skills
May Contain Skills
 
Joined: Mon May 02, 2005 9:40 am
Location: Its this place, with air, and buildings, and there is lots of concrete...

Postby Blink on Thu May 19, 2005 7:03 am

Grim Reaper wrote:I dont see why you just put in a river or something, create hills and stuff behind it and then put in a player clip. Much eaiser.


Obviosly you don't understand it then
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby reeke on Thu May 19, 2005 10:54 am

if you did that, performance would take quite a punch. the skybox allows large areas to be made that are much easier to handle because theyre scalled 16X.

its great in concept put personally i dont like the 3d sky box for that one reason, at 16X the textures look quite horrible, they have to be reallllyyy far in the distance if theyre to look ok, so its best if the player cant see exactly were the map ends and the 3d skybox starts :wink:
User avatar
reeke
Senior Member
Senior Member
 
Joined: Sun May 01, 2005 4:49 pm

Postby CrapinaBottle on Thu May 19, 2005 9:27 pm

soooo..... y dont u just make the enlarger 12X or 8X?
CrapinaBottle
Regular
Regular
 
Joined: Sun Apr 17, 2005 4:41 am

Postby Grim Reaper on Sun May 29, 2005 9:46 am

This is a complicated tutorial.. sorry blink if i wasnt such a newb id probably understand :cry:
Grim Reaper
May Contain Skills
May Contain Skills
 
Joined: Mon May 02, 2005 9:40 am
Location: Its this place, with air, and buildings, and there is lots of concrete...

Postby Blink on Sun May 29, 2005 9:49 am

It's not easy to grasp at first, try this as well.

http://www.interlopers.net/downloads/vi ... skybox.rar
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby Grim Reaper on Sun May 29, 2005 9:51 am

What is it?

Is it a video, its a rar file right?

Not sure if i have win rar... ill have to fish it up
Grim Reaper
May Contain Skills
May Contain Skills
 
Joined: Mon May 02, 2005 9:40 am
Location: Its this place, with air, and buildings, and there is lots of concrete...
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users