func_areaportalwindow

From Source Entities
Jump to navigation Jump to search
Hl2 d2 coast 09 areaportalwindows.png

Code classes:

Areaportal.png

func_areaportalwindow is a brush entity present in all Source games. It creates an areaportal that automatically closes as the camera moves away, replacing itself with a second brush to fill the gap.

Bug: (Known to affect Half Life 2) The dev/dev_window texture has to be on both sides of the brush. Combining it with any other texture (except nodraw) will result in rendering glitches (objects popping in and out of the PVS depending on player position and view angle).

An example use is on the right, from d2_coast_09Hl2.png. When the player is close to the window, the entity is open and the game only renders what's directly visible through the window as opposed to the entire PVS. When the player backs up, the view outside is replaced with a hazy low-res texture. Aggressive use of areaportals allows the engine to only render a small fraction of the outside at once.

Keyvalues[edit | edit source]

Rendered Window (target) <target_destination>
The brush entity that fills the gap left by the portal when closed. This entity's textures should not have transparency in its textures.
Fade Start Distance (FadeStartDist) <int>
Distance that the fade into the Rendered Window brush entity begins. The further back the player views, the more visible the brush entity will be.
Fade End Distance (FadeDist) <int>
Distance at which the Rendered Window is fully visible, and the portal closes.
Translucency limit (TranslucencyLimit) <float>
Keeps the Rendered Window at least this visible at all times. Useful if your rendered window uses an opaque glass material. 1.0 means always fully visible.
Foreground bmodel (BackgroundBModel) <target_destination>
Optional brush entity that is drawn when the portal is open. This can simulate effects like moisture on windows.

Inputs[edit | edit source]

SetFadeStartDistance <int>
Sets Fade Start Distance.
SetFadeEndDistance <int>
Sets Fade End Distance.

See Also[edit | edit source]