WiseOneWayGlass: Creating One-way Glass

From Valve Developer Community
Jump to: navigation, search


This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

Introduction

Creating glass for Source Source is a simple matter of properly texturing brushes. In this sample room I’ve created there are three windows. There is also an illusionary wall with layered textures.

The three windows

Creation

The first window is a typical one-way glass.

  • On one face it’s textured with glass\glasswindow070a
  • On the opposite face it’s textured with the same brick texture I used on the walls: brick\brickwall003a
Tip.pngTip:You could also texture it with any opaque glass texture.

To browse for these textures:

  • Click the Toggle Texture tool, or press Shift+A.
  • Now click the Browse button.
  • In the lower Filter area enter filter words like “glass”, “wall”, etc.
  • Double-click on the texture you want to use.
  • Now with the Face Edit tool still open, right-click on any brush face to texture it. (left-click selects faces)

All other faces of these Glass brushes will be textured with tools\toolsnodraw]].

To illustrate what you can achieve I’ve created 4 different types of see-thru areas.

Starting from the left:

  • Typical one-way glass.
  • Breakable Glass made with func_breakable_surf (more on that soon).
  • Normal brush with nodraw on one face and a glass texture on the opposite face.
  • Layered textures created with func_illusionary entities.
Blends in with the wall

The one-way glass is created with a normal brush that has any opaque textured face opposite a glass textured face. In this example I’ve used a brick texture and opposite that a glass texture. The Breakable glass is created by turning a normal brush into func_breakable_surf. Do that by selecting the brush and pressing Ctrl+T, choose func_breakable_surf, and finally click Apply.

The properties for our breakable window are:

  • Prop Data: Glass.Window
  • Health: 80
  • Material Type: Glass
  • Fragility: 50
  • Surface Type: Glass
  • This Breakable glass is 1.0 units thick.
Don’t make them thinner than 0.5 units thick and don’t make them too thick.
Breakable glass gets textured on only one face, all other faces will be textured with nodraw, the easiest way to do that is create them entirely with nodraw and then use the Face Edit tool to apply the breakable glass texture.

The texture to use on that face is: glass\glasswindowbreak070a (Don’t use the b version.)

Notice the normal world brush with nodraw on the face opposite the glass face. When you compile this type of glass it will look like normal unbreakable glass on one side but on the other side it will be clear, however, it will block objects.

The three windows

The last example is our layered texture, created with func_illusionary entities. The first brush is only textured on the outside face; metal\metalfence004a The next brush is textured on two faces; metal\metalgrate013a and brick\brickwall003a. All other faces are textured with nodraw.

To create brushes that are 0.5 units thick use the Transform tool

With the methods illustrated here, you can create any type of one-way glass you need.

Note.pngNote:The player, and objects, can pass right through the illusionary wall.

Keep in mind that while the nodraw texture doesn’t show it was invaluable in creating these effects.

Here are some shots of the effects in the game:
WiseOnewayGlass04.jpg
WiseOnewayGlass05.jpg
WiseOnewayGlass06.jpg

See also