Optimization: Prop/Model hiding

Noggin

L5: Dapper Member
Nov 17, 2007
226
48
This I learnt thru trial and error but can work very well.

Using func_occluder to hide models

I use it by placing a 1 unit wallpaper like the pic below,
Apply nodraw texture to all faces except the one facing the player that texture should be "tools/toolsoccluder", make it a func_occluder entity.

This will hide models behind it so be careful where u place it, players will disapear too if incorrectly placed!

In dev mode I use these key binds to show the occluders at work, the green boxes are the models being hidden by the occluder:

bindtoggle "o" "r_occlusion"
bindtoggle "p" "r_drawpixelvisibility"
bindtoggle "[" "r_visocclusion"


func_occluder.jpg


Max view distance

Also with all props/models set the max view distance etc, you can set the distance using the camera button in the entity properties window .
If the player cannot see the model then there is not point in displaying it all the time, models behind walls for instance.

I find the longest line of sight that the player can see the model, go a little further then set the max view distance, you call also set the fade for smaller props like light fixtures etc.

In my case, I hid the generator in the base (big red block) to players outside of the base, determined by distance.

model_hiding.jpg
 
Last edited:

Paria

L5: Dapper Member
Dec 12, 2007
202
31
is there a specific point at which you should decide to start using occluders ? since i found a brief reference to them on the optimization guide, but if you have decent area portals and hints at what point is adding these a good idea ?

and for the binds have you tried

sv_cheats 1
perfui

occlusion tool.
 

Noggin

L5: Dapper Member
Nov 17, 2007
226
48
In my case, it was a big outdoor area so areaportals were not feasible. Hints dont always hide props as much you might like them too either, you will often find things being drawn that shouldnt.
 

Vilepickle

Banned
Oct 25, 2007
372
199
That's a unique way to use them I suppose, but due to their nature of hiding everything behind them they are a "last resort" optimization technique. Honestly, with a building like that and the walls, they shouldn't be drawing things on the other side of it anyway with properly placed hints and/or area portals as long as the right things are structural brushes and the right things are detail.

As you said yourself, it's probably better just to set fade distances on props that are being drawn in the wrong spots.

Also: isn't there an overhead rendering cost for occluders as well?
 

Sacrifist

L3: Member
Nov 21, 2007
130
7
I thought you had to have all 4 faces of the brush as an occluder. Didnt think it would work if you had nodraw on some of the faces.
 

Noggin

L5: Dapper Member
Nov 17, 2007
226
48
This is a screenshit with the Occluders switched in and out, the occluder performance hit seems less than the cost of the props. All depends on the scene really.

ctf_powerhouse_occluders.jpg