Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/archive/global.php(40) : eval()'d code on line 2
Optimization: Prop/Model hiding [Archive] - TF2Maps.net Forums

PDA

View Full Version : Optimization: Prop/Model hiding


Noggin
03-08-2008, 03:53 PM
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"


http://i182.photobucket.com/albums/x291/jagshrapnel/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.

http://i182.photobucket.com/albums/x291/jagshrapnel/model_hiding.jpg

Paria
03-08-2008, 04:05 PM
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
03-08-2008, 04:27 PM
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
03-08-2008, 04:54 PM
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?

Shmitz
03-08-2008, 05:09 PM
There is. Occluders should only be used if they will be hiding a significant number of models.

Sacrifist
03-09-2008, 03:00 AM
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.

Shmitz
03-09-2008, 03:52 AM
You actually only want one of the faces to be occluder, or else the engine will have to calculate the occlusion for every face on the brush, which just increases the already mentioned overhead.

Noggin
03-18-2008, 06:48 PM
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.

http://i182.photobucket.com/albums/x291/jagshrapnel/ctf_powerhouse_occluders.jpg