Posted by: Bulk
Date posted: Nov 22 2004 User Rating: 4.3 out of 5.0 | Number of views: 28957 Number of comments: 10 | Description: A guide on the three diffrent types of glass the source engine is capable of |
This tutorial assumes you have basic knowledge of Hammer, either from Half-Life 1, or Source engine level design experience. You are expected to know how to place and create brush based entities, and know how to make at least a simple room.
By the end of the tutorial, you should be able to understand the different kinds of glass available, and how to make them.
There is an example map available (below), however this tutorial will assume you are building it all from scratch.
New style glass
There are three types of glass in the Source engine. The first kind is the new kind. This is the glass that you will have seen if you have played Half Life 2 (or cs_office in Counter Strike: Source), its defining feature is the ability to shatter when shot but stay intact – instead the glass is destroyed a bit at the time. E.g.:
This type of glass is fairly simple to make, but there are a few things you need to know to get the best out of the effect.
Firstly, make a room, lights and start point etc. Then you need to make a brush for your glass, any size will do. Any material that has been defined as glass can be used for this, but in the example map I used "glass/glasswindowbreak070a".
Now, the very important thing to remember is that only 1 surface on the glass brush should contain the glass material. All the other sides should have the nodraw texture on it. When it's rendered in game the glass texture will appear on both sides and the glass will have no thickness.
There is one more step: turning the brush into an entity! For this kind of glass we use the func_breakable_surf entity. Go ahead and tie the glass brush to that entity now, then open its properties.
There are lots of options in the list, but I will only explain the pertinent ones:
"Prop Data" should be set to "Glass.Small".
The help file says that the "Health" field controls how much damage the glass takes before breaking, but it doesn't seem to have an effect. I think this is controlled in the material file, so for now just leave it set to 5.
"Material type" should be set to "Glass", as should "Surface Type".
"Fragility" controls how fragile the glass fragments are after being broken. For instance if this is set to a very high number (like 300) all the glass will shatter the moment it's broken. If you set the number very low (to 5 for instance) it will take a lot of built hits to completely destroy the glass. A number between 100 and 200 emulates real glass pretty well.
Note that unlike glass in Half-Life 1, you don't need to change its "Render mode" or similar options as its transparency is defined in the textures alpha channel.
Old style glass
This is the glass you know so well from Half-Life. It's built the same way you built the glass for the previous type, remembering to texture every side but one with the nodraw texture.
However instead of func_breakable_surf, we tie it to a normal func_breakable entity.
Again I will only explain the relevant attributes.
"Prop Data" as before, should be set to "Glass.Small".
Like the "Health" field above, "Strength" does not seem to have an effect, so leave it set to 10.
"Material type" should be set to "Glass".
And that's it. The moment the glass is shot it will shatter and disappear completely (unlike the new style glass that leaves a broken rim of glass).
Unbreakable glass
This is the easiest of the three to make. It starts the same way as the others, glass brush with the nodraw texture all on sides but one. Then all you have to do is tie it to the func_detail entity, and you're done! No settings to configure.
That's it for this tutorial. It's all pretty straight forward but if you have any questions (or spot any omissions/mistakes) please post them in the comments below. |
|
User Comments
Showing comments 1-10
pretty good tutorial, i was actually wondering howto do this when i was checking out hammar earlier.
but as you can guess i didnt investigate very far :) |
|
i just cannott get this to work. |
|
ok how can i make this so that you cannot shoot through the glass? |
|
I havn't tested it, but I assume if you create a second brush covered entirely in the tools/clipbullits material, and place it behind the glass brush, it should work as you wish. |
|
will that work for both sides of the glass? |
|
The side where the brush is, probably wont have any bullit decals, but it should work (Again this is all in theory, the best way is to experiment). |
|
i dont like this glass at all.....you cant have 2 sides of it showing the bullet decals and for many windows that arent to be broken at all...this really sucks....and placing 2 of these back to back looks like hell if the window is a stained glass texture :(
ill try that clipbullets idea and tell if it worked tonight...i sure hope it does.
i also have a problem with glass disappearing after a compile but only on one side
albeit...this is for a MP mod im working on........i have 18 wiondows in this cathedral that cant be broken and sometimes the very ends of the building from the inside you cant see the glass.....and can also shoot right through it
clipbullets material better host decals :) |
|
Every time i make a window in my level it errors out as soon as it comes into view. Yet I made a level with 8 levels of big glass plans. Why would that work but putting two plans in my other level not work??? |
|
So how do I edit how many bullets or how mutch damege the glass material can take befor it breacks. See I am tying this to a brick brush and I want to make it so it dosn't breack in like 2 shots. |
|
You must register to post a comment. If you have already registered, you must login.
|
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (2 guests)
|
|