func_occluder

func_occluder is a semi-internal brush entity available in all
Source games. It hides models that are entirely covered by it in the player's view, according to how it has been textured.
| CFuncOccluder |
Unlike func_areaportal or other optimization tools, occluders perform visibility calculations at run-time. They do not cut visleaves, and they do not hide world geometry (world brushes, displacements, etc). Because of this, they are much less effective when directly compared to areaportals or good Hint brush placement for optimization, and should be used primarily when the former strategies are not possible or ineffective on their own.
Occluder "" straddles multiple areas. This is invalid!. This warning is mostly obsolete. Removed in map_noareas 1) or past a closed areaportal. This may manifest more often when merging lots of occluder brushes into one entity, and even more so when spread across separate areas of the map (for example, multi-stage payload maps in Usage
Occluders are very useful in cases where you have reasonably large func_detail, prop, func_brush, or displacement walls. These walls do not cut visleaves, meaning they will not stop world brushes, other displacements, or other props from rendering behind them. If you cannot use areaportals or hint brushes, occluders will at least hide props.
Occluders can also be helpful if certain parts of your map do not allow for efficient visleaf cuts, such as cylindrical buildings with multiple doorways, or flat open spaces with some geometry that can still block player vision. An example of this would be
Left 4 Dead's c8m1_apartment. Large occluders are used on the floor of the survivor starting area to hide props on the floors and street below, as well as the alley walls after leaving apartments.
Texturing
The occlusion will only work if the player is looking at the side that has the toolsoccluder
texture applied, any nodraw
faces will not occlude. This means you could make, for example, a large func_occluder cube, apply nodraw to the entire thing, then apply the occluder texture to only two faces. Only those two sides will hide models when the player is facing them.
-nodrawtriggers or -xbox. Debugging Commands
r_occlusion- Activate/deactivate the occlusion system.
r_visocclusion- Activate/deactivate wireframe rendering of what the occlusion system is doing.
r_occludeemaxarea- Prevents occlusion testing for entities that take up more than X% of the screen. 0 means use whatever the level said to use.
r_occluderminarea- Prevents occlusion testing for entities that take up less than X% of the screen. 0 means use whatever the level said to use.
r_occlusionspew- Activate/deactivates spew about what the occlusion system is doing.
r_occludermincount- At least this many occluders will be used, no matter how big they are.
Keyvalues
- Name (targetname) <string>
-
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Initial State (StartActive) <boolean>
-
Default Value: 1
If the entity starts inactive, use theActivateorToggleinputs to turn it on.- 0: Inactive
- 1: Active
- Occluder Number (occludernumber) <integer> !FGD
- Automatically inserted by VBSP to distinguish occluders; should not be handled manually.
Inputs
- Activate
- Deactivate
- Toggle
- Control the state of the occluder.
External links
- Visibility Optimization
- Wikipedia on Antiportals (another word for occluders)