WiseLayeredGlass: HL2 Layered Glass

From Valve Developer Community
Jump to: navigation, search

This tutorial was originally created by wisemx.

Ported from SDKnuts.net to VDC by: Pinsplash (talk) 12:37, 11 July 2018 (UTC)

An example of func_areaportalwindow on d2_coast_09<Half-Life 2>. When the player is close to the window, the entity is inactive and the player can see through the window. When the player backs up, the objects outside are culled from the PVS and replaced with a hazy low-res texture.
Note.png Note: This is an advanced method; it is not required for typical windows. A few mappers have E-Mailed me about not being able to get this method to work for them. The Areaportal layer mentioned in this project isn't an actual Areaportal. It's textured properly only to illustrate which layer will become the func_areaportalwindow in your map.


A common feature of the windows you see in HL2 along the coast levels are windows that seal the house (area portals) and also create illusionary effects:

  1. From a little further away the window blocks your view.
  2. A little closer and the view through the window is clear.
  3. Break the glass and part of the frame breaks with it.


There are 4 glass panels and two dynamic props involved.

Glass layers (From outside in)

  1. func_illusionary panel 0.5 units thick. Textured on outer side with glass\glasswindow026a, inner side with dev\dev_windowportal
  2. func_illusionary panel 0.5 units thick. Textured on outer side with tools\toolsnodraw, inner side with lights\white002.
  3. Brush 0.5 units thick textured with tools\toolsareaportal.
  4. func_breakable textured with glass\glasswindow017a.
Note.png Note: If you aren’t using areaportals you do not need the third glass panel.

The func_breakable glass panel needs an Output to force the inner frame prop to change to its broken look:

  My Output Target Entity Target Input Parameter Delay Only Once
OnBreakName window_bars SetBodyGroup 1 0.00 No

Frame parts

  • Outer frame is prop_dynamic.
    • World model: models/props_wasteland/plasterwall029c_window01a.mdl
    • Disable Shadows: Yes
  • Inner frame is also prop_dynamic.
    • World model: models/props_wasteland/plasterwall029c_window01a_bars.mdl
    • Disable Shadows: Yes
    • Name: window_bars
    • Collisions: Not Solid
    • Randomly animate: No
    • Body group: 0
    • Start disabled: No

Notice when the inner frame spawns the Body group is set to 0. Once the glass panels are layered they will appear to be one unit and because they are only 0.5 units thick the overall thickness is only 2.0 units. The Transform tool is very helpful in creating and moving super thin brushes.

In the sample project below I’ve created all of the panels and a frame for them. I’ve left the brushwork spaced outside of the window, so you can practice.

See Also