func_occluder
Code classes:
CFuncOccluder
CBaseEntity
(all ents)
func_occluder
is a brush entity present in all Source games. It hides models which are completely obscured by the brush. Sides of a func_occluder
that are textured with nodraw will not be factored into occlusion calculations. See Max occludee area and Min occluder area in worldspawn
.
Poor occluder usage is worse for performance than not having any! Check if your occluders are actually helpful by using net_graph 1; ent_fire func_occluder toggle
in the console to switch them between their on/off states.
The issue comes down to two things: how long it takes to trace lines to each model on-screen to check for line-of-sight (increases as more models are added, not affected by the complexity of said models), and how long it would take to render the occluded models (increases with model complexity and somewhat for each individual model, regardless of complexity). The line-tracing part of this has to be done with high precision and granularity to avoid de-rendering things that are actually visible. Occluders start to hurt performance when the cost of checking each model for line-of-sight outweighs the benefit of not rendering the model.
Areaportals on the other hand experience less overhead because they use a much less precise culling method. What these two have in common is the fact that they're used in scenarios where hinting is impractical or impossible. Another way in which occluders are inverse from areaportals is how their size correlates to their effectiveness. Large occluders are better than small ones because they cover a larger portion of the screen and can occlude more objects.
ConVars/Commands[edit | edit source]
ConVar/Command | Parameters or default value | Parameter Type | Effect |
---|---|---|---|
r_visocclusion | 0 | 0 disables, 1 enables | Shows what is being culled by the occluder. Requires sv_cheats 1 in the console before taking effect. |
Keyvalues[edit | edit source]
- Initial State
(StartActive)
<choices>
- How the occluder starts off. Use inputs to activate it.
- 0: Inactive
- 1: Active
Inputs[edit | edit source]
- Activate
- Makes the occluder active. (De-render models obscured by it.)
- Deactivate
- Makes the occluder inactive.
- Toggle
- If on, turn off. If off, turn on.