Tutorial: New Glass Last edited 3 months ago2024-09-20 03:13:01 UTC

Download attachment

Glass

Glass, you've all seen it in one form or another. Its a good way to detail maps because they make almost all indoor and urban environments look way more interesting than they actually are. If you want it in game, this tutorial will go over the three different types that you may encounter.

To get started, we will need a room with an info_player_start, a light_environment, and three "windowframes".
A block room and three window frames -- Awesome I know.A block room and three window frames -- Awesome I know.

Bullet Proof Glass

Bullet proof glass is the most simple of all. If you're coming from Half-Life 1 mapping, this is now alot easier. You no longer need to manually add the texture to define it's transparency. Now the transparency is built into the texture. (This tutorial will not cover how that is done)

In one of your frames, create a brush to fit it. Now, open up your textures tab and find a nice glass texture to put on it. For this panel, I have used glass/glasswindow070c

Your indestructable glass panel is now complete. It should render transparent inside hammer as well as in-game all by itself without any entity work.

HL1 Style Breakable Glass

This is the style of glass that, once prompted to break, will shatter the entire pannel all at the same time

Now, fit another brush to your second window frame. Select the brush, and texture it with glass/glasswindow070c once more. While it's selected, right click and Tie to Entity. Choose the dropdown box and find func_breakable. Once again, the glass will appear transparent all by itself so you do not have to change the render type/amount.

Important Properties Related to Glass: Flags: Now, if you've set this up correctly, this glass will break upon taking the amount of damage that you've set as the strength. My value of 1 will cause the glass to break if hit or shot by anything. Once the glass breaks, no trace of the glass will be left on the edges of the frame. It breaks off 'cleanly'.

Location Based Glass

This is the type of glass that will break off in chunks and peices rather than the entire thing at a time. This type of glass is sometimes annoying to set up depending on what you want.

Start by fitting the third frame with a brush. This brush should not be intersecting or overlapping with ANY surrounding brushwork or it will mess up. This brush should also be only 1 unit thick as this type of glass does not like anything thicker. This type of glass is also picky as to how it should be textured. Texture all 6 sides to the texture tools/toolsnodraw. Now, texture specifically one of the viewable sides of this brush to glass/glasswindowbreak070a. Note: This is the only texture equipped to break in a peice-style manner. No other textures should work. It is also important to note that both sides of this glass will show the texture rather than just the side you textured.

Now, rather than Func_breakable, choose the dropdown box and set it as a Func_breakable_surf. The only notable changes from the func_breakable from earlier is the property name change from strength to health, the addition of the surface type field, and the addition of the fragility field.

Set Material Type and Prop Data as earlier and set the Surface type to Glass. Also, set the Fragility to 200. The Fragility field determines how "fragile" the glass is. It decides how much glass will chunk off at a time. The higher the value, the more prone the glass is to shatter all at one time.

Once you shatter this type of glass, there are peices of broken glass stuck to the frame after it is destroyed. This is the 'unclean' breakoff. Also, do not place two of these planes of glass next to eachother without a border. If you do, the broken frame shards of glass will not appear.
Don't place surf glass next to eachother.Don't place surf glass next to eachother.
You should now have an awesomely boring room with 3 panels of glass. ;oYou should now have an awesomely boring room with 3 panels of glass. ;o
Now, you should know how to create 3 flavors of glass. Use them. As mentioned earlier, they make almost any space more interesting. It does not make this space more interesting. This example map is very lame.

4 Comments

Commented 16 years ago2008-02-24 19:12:38 UTC Comment #100809
nice one =]
Commented 14 years ago2010-02-08 08:33:23 UTC Comment #100810
When I try to make a window with the Func_breakable_surf entity, I can only see the glass on one side, the other side of the window is fully clear, what am I doing wrong?

Note that I am not using the same texture used in this tutorial. This is because I can't choose it from my list of textures, how can I make it available?

As a compromise, how can I cut a little hole in the window to make it loook broken.
Commented 14 years ago2010-04-04 20:19:45 UTC Comment #100811
What's the thing about adding a env_cubemap to the surface with the glass texture, that I read about on the Valve developer community?
Awesome tutorial by the way =)
Commented 13 years ago2011-03-03 20:14:19 UTC Comment #100812
i follow all the steps, but the last glass wont show on hl2, in the console i have this error:

Rejecting func_breakablesurf. Has multiple faces that aren't NODRAW.

but all the faces are nodraw except the front

You must log in to post a comment. You can login or register a new account.