Func occluder: Difference between revisions
m (clunky wording) |
(Hammer can collapse these fine) |
||
Line 7: | Line 7: | ||
{{Note|[[VBSP]] may display a warning saying <code>Occluder "" straddles multiple areas. This is invalid!</code>. This warning is obsolete and will not affect functionality. Removed in {{mapbase}} VBSP and [[VBSP++]].}} | {{Note|[[VBSP]] may display a warning saying <code>Occluder "" straddles multiple areas. This is invalid!</code>. This warning is obsolete and will not affect functionality. Removed in {{mapbase}} VBSP and [[VBSP++]].}} | ||
{{Bug|occluders placed in an [[Instance]] will not work due to VBSP not transforming the brushes when collapsing. | {{Bug|occluders placed in an [[Instance]] will not work due to VBSP not transforming the brushes when collapsing. Fixed in [[VBSP++]]}} | ||
== Usage == | == Usage == |
Latest revision as of 05:47, 17 September 2025



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 obsolete and will not affect functionality. Removed in 
Usage
Occluders are very useful in cases where you have reasonably large func_detail, prop, func_brush, or displacement walls. These walls also do not cut visleaves and therefore will not stop props from rendering behind these walls. Adding an occluder inside the same wall will at the very least hide all props behind the brush entity walls.
They can also be very helpful if your map layout does not allow for efficient visleaf cuts in an area with a lot of visible detail props. In this situation, you can embed func_occluders in the surrounding geometry to at least reduce the amount of props rendered. An example of this would be Left 4 Dead's
c8m1_apartment
, where large occluders are used in the survivor starting area and the alley after leaving apartments to hide large amounts of props.
Texturing
The occlusion will only work if the player is looking at the side that has the Occluder 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.
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>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
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>
- If the entity starts inactive, use the
Activate
orToggle
inputs to turn it on. Default value is 1.- 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)