This article will occlude, sorry conclude the “practical guide” series that I started 2 months ago with the practical guide on hints placement and areaportals. As I mentioned in the previous ones, this article is not a tutorial nor a wiki on occluders but rather a practical guide on how I proceed with occluders in a systematic way and the key locations to place these occluders. For the rest of the article, I will assume that you are familiar with the working of the Source engine and that you have an understanding of occluders, visleaves and overall optimization. If it is not the case, then it is highly advisable to start on the Valve developer Wiki page (Occluder Wiki) and (optimization), as well as read my comprehensive Source optimization paper (Man vs Engine) for an in-depth explanation of occluders and optimization in general.
Occluders are expensive. I tried to buy a second-hand occluder yesterday and the salesperson tried to rip me off with double price as if it was the black market. I swear I will…nervous chuckle…there seems to be a mix-up, you never heard anything from me.
Occluders work in real time in-game and are expensive resource-wise (their visibility calculation is done on the fly in the map as opposed to hints and areaportals which are calculated during VVIS compile time). I have explained occluders in full details in my paper Man vs Engine (paragraph III.9).
Occluders are very useful but in very specific conditions; 90% of maps can be optimized without occluders. For the remaining 10%, occluders will come in handy in situations of high number of models in an open area without much regular world brushes to implement hints/areaportals.
Occluders were named after the medieval Irish king, Seamus O’Cluder, who used to hide his models and servants in the castle away from the public eye… true story. Now if you don’t believe this “legit” piece of history (and I don’t blame you), the one thing that you should trust is that occluders only hide models (including player and weapon models), not brushes.
Always remember these three conditions before you even think of using occluders: they are expensive, only hide models, and are more suited to open areas with few to no regular world brushes.
Great. With that off my chest, let’s see where the potential key locations for placing occluders are.
By floating, I certainly do not mean hanging mid-air like a Xen map from Half-Life. Floating here suggests that the wall is more or less detached from other solid structures, and usually at low heights.
The above screenshot taken from the Counter-Strike Source map cs_compound is a classic example of floating walls.
The wall is short and encircles the whole compound area; it is also a func_detail so hints and areaportals are not much useful here. The container to the right is also considered a floating wall, regardless of its function (cargo container).
Notice the white rectangles denoting the occluders that are neatly inserted inside the brushes while all green models are hidden due to the occluding effect and the red ones are visible.
This screenshot is taken with all details hidden to give you an idea of the actual regular world brushes left in-game. You clearly see that the map is really wide-open and empty with not much work that can be done with hints and areaportals.
The walls and containers (now hidden in the screenshot) were scattered across the map, making them floating by definition. Just remember the second condition for occluders: there have to be enough models to warrant the price of the occluders. This means that if there are no models behind those walls, then there is absolutely no need to add an occluder.
Here’s another example of floating walls taken from cs_assault in Counter-Strike Global Offensive.
The floating wall is actually two stacked func_detail containers, but because they are not part of buildings, they are considered detached. And since they are located in the middle of an open intersection in front of several models, the occluder is justified (again, the white rectangle inside the container is the occluder).
Another type of wall that is prime location for occluders is the “thin wall”. By thin, I don’t mean paper thin but rather any wall that is part of a house, warehouse or building that separates indoors from outdoors.
Returning to cs_compound, the warehouses thin walls are good examples to demonstrate this type of walls.
Occluders are totally inserted inside the walls of the warehouse to cull models on both sides of the wall whether the player is outdoor or indoor. Always make sure that your occluder brush is absolutely contained inside the brush it is in without any poking parts (if your brush is 4 units wide, then make your occluder 2 units to be on the safe side).
It is worth mentioning that occluders and areaportals should never touch or cross paths… or there will be blood (their rivalry goes back to World War I as I have been told by an elderly person in the village – yep, another “legit” true story).
If your occluder has to cross an areaportal, then split the occluder in two parts on each side of the areaportal to avoid any contact between them.
Another solid example is found in the CSGO map de_stmarc.
This is the map with all details hidden. As with cs_compound before, the map is really open with few solid structures (and a lot of models not seen in the screenshot). As you might have guessed by now, this is the perfect recipe to use occluders, thin-wall edition.
You can see in the above screenshot how the occluders are scattered inside the different thin walls of the various houses. You can observe some occluders that are showing without being inside brushes; that’s because the func_detail part of the wall/house that contains them is not shown in the screenshot but rest assured that every one of these occluders is neatly hidden inside a brush.
Let’s see those occluders in-game.
And for a more general view of the occluders in the map.
If you thought this is the name of a historic battle, then I am sorry to disappoint you; the name you are looking for is “Bunker Hill”.
Similar to floating walls, any small to medium hill made of displacements and that separates two areas on each side with a considerable amount of models is a natural target to place an occluder.
In the above screenshot, you can spot a fairly medium-sized displacement hill at a relatively low height (crosshair location). As you might have predicted, hints and areaportals won’t do much in this setup because of the lack of sufficient regular world brushes to support them. In this case, an occluder should be placed inside the displacement, going from ground level to the tip of the hill (from the inside), while also making sure that no parts of the occluder protrude outside the displacement.
Here is this particular occluder in action.
As with the brush-made floating wall, a floating prop of considerable size such as a fence or hedge is also a candidate for occluder placement.
The same ground rules apply: make sure that the area has a considerable amount of models, that hints/areaportals are not much viable setup, and that the occluder is totally contained within the prop.
Here is a small test map that I cooked for this example.
As in previous examples, the occluder is the white bordered rectangle while the green hidden props on the left are static props and the small ones to the right are physics props. Both the hedge and the wooden fence are prop_static and the occluder brush is only 1 unit thick to make sure it is completely hidden inside the props.
In the case of props, it is absolutely more important to make sure your occluder is not poking outside the edge of the prop that contains it. If the occluding face is outside the prop, then the latter will be… yes, you guessed it, culled (this is what occluders do, don’t they). You can clearly visualize that your setup will be flawed and unrealistic with hidden props in front of the players without any visual block to support the culling.
4.A bit of testing
Although I have mentioned in the introduction that this article is not a wiki nor a tutorial on occluders and even if I have explained occluders in detail in my paper Man vs Engine, I really feel that I should briefly repeat my explanation on proper occluder testing (cost vs benefit for fps). This is a crucial topic when it comes to occluders working in real time in-game.
I certainly do not want you to go on an occluding spree and start adding occluders whenever you see a floating wall/displacement or prop, without proper justification or fps testing.
Always remember the conditions for occluders: expensive, hide models, work in open space with little world brushes.
Also keep in mind that most maps do not require occluders. Keep trying with areaportals and hints until you feel that the low-ish fps in a specific area can’t be improved anymore, and that the area is model-rich with open unobstructed lines of sight. Then, and only then, think of occluders.
Now that you know when and where to place an occluder, the important question is how to tell if your occluder is helping with fps or making things worse because of its high cost. Proper fps testing is the plain and simple answer.
After you implement your occluder, test your fps in-game near the location of the occluder. Once you take note of the frame rate, disable occlusion by typing r_occlusion 0 in the console and check your fps again at the same location. If the fps remain the same or increase, then your occluder was useless and eating up precious resources; remove immediately without blinking.
On the other hand, if after disabling occlusion, your fps plummet considerably, then your occluder was doing a good job maintaining a higher fps which totally justifies its cost.
It is worth mentioning that Valve disabled this console command in CSGO and thus, it can’t be used to test the occlusion system. To counter this issue and test your occluders, compile a second version of the map while hiding the occluders visgroup in Hammer to prevent them from compiling into the game (name your second map as something similar to “de_yourmap_occluder” to differentiate it from the main map with occluders included). The fps testing will be carried out in a similar manner to confirm the need for the occluders.
5.Conclusion or occlusion
Occluders are very powerful tools in the optimization arsenal but are costly at the same time and need to be handled with care. Think of them as weapons of mass destruction; you don’t use them unless you’re absolutely sure of the outcome.
As I mentioned several times earlier in this article and in previous papers, most maps can be safely and solidly optimized without occluders.
Occluders are used in very specific conditions; keep trying with hints and areaportals and only after you reach a dead end where those are not feasible, resort to occluders.
> **Posted by Tinkerton**
> > **Posted by will2k**
> > > **Posted by LATTEH**
> > >
> > > You can also use Skip or nodraw on the face you don't want to have occluder to cull props
> > Hi Latteh :)
> > Of course, you only apply the occluder texture on the face you want to hide models behind while all other faces get nodrawed or skipped; This was explained in details in paragraph III.9 of my paper Man vs Engine.
> > good luck for Kandagal :)
> Isn't it better to use only Skip and not NoDraw? Going from my experience in CoDRadiant (not entirely sure if this is the exact case in Hammer), NoDraw/Caulk tends to create holes in the faces it's pressed up against, but also has collision calculation. Using only Skip would then minimize the chances of creating such problems and be marginally more optimized, right?
You have my guarantee that nodraw will not cause any issues with occluders.
> **Posted by kinggambit**
> > **Posted by will2k**
> > Is this your insurgency map? how much is the fps gain after implementing occluders?
> yup! to be honest, i'm not sure how optimized it got. It was circumstantial since there's not many suitable areas for occluders on my level (even though it's mostly an open environment).
Perform a localized fps testing with and without the occlusion system to check the gain or lack thereof in frame rate (refer to my paper "optimization testing" for methodology)
> i think i'll have to do some testing with occluders to see how many i should make i.e. The big mosque in the middle of the map has 4 beveled corners + 4 doorway entrances (so ~12 brushes). Since occluders are expensive, I never planned on adding any to that area:
Judging by the screenshot only, I do not think you need occluders; plenty of areaportals with some well placed vertical/corner hints will be enough to maintain your visleaves under check. However, if these outer temple walls are mostly func_detail then occluders become viable.
> **Posted by will2k**
> Is this your insurgency map? how much is the fps gain after implementing occluders?
yup! to be honest, i'm not sure how optimized it got. It was circumstantial since there's not many suitable areas for occluders on my level (even though it's mostly an open environment).
i think i'll have to do some testing with occluders to see how many i should make i.e. The big mosque in the middle of the map has 4 beveled corners + 4 doorway entrances (so ~12 brushes). Since occluders are expensive, I never planned on adding any to that area:
> **Posted by will2k**
> > **Posted by LATTEH**
> > You can also use Skip or nodraw on the face you don't want to have occluder to cull props
> Hi Latteh :)
> Of course, you only apply the occluder texture on the face you want to hide models behind while all other faces get nodrawed or skipped; This was explained in details in paragraph III.9 of my paper Man vs Engine.
> good luck for Kandagal :)
Isn't it better to use only Skip and not NoDraw? Going from my experience in CoDRadiant (not entirely sure if this is the exact case in Hammer), NoDraw/Caulk tends to create holes in the faces it's pressed up against, but also has collision calculation. Using only Skip would then minimize the chances of creating such problems and be marginally more optimized, right?
> **Posted by KIPPER**
> Really interesting post, definitely keeping this bookmarked thanks!
Thank you :)
> **Posted by kinggambit**
> :D I AM POWERFULLLLL!
Is this your insurgency map? how much is the fps gain after implementing occluders?
> **Posted by LATTEH**
> You can also use Skip or nodraw on the face you don't want to have occluder to cull props
Hi Latteh :)
Of course, you only apply the occluder texture on the face you want to hide models behind while all other faces get nodrawed or skipped; This was explained in details in paragraph III.9 of my paper Man vs Engine.
good luck for Kandagal :)
> **Posted by Sally-2K**
> Thanks for the new term
> **Posted by Tinkerton**
> Will2K, you magnificent bastard! What would we do without you? I just honestly wanna say thank you for demystifying some of the most unintuitive and downright backwards inner workings of the Source engine (as well as your screenshot tutorial - also pretty useful). You deserve a medal.
Thanks for your enthusiastic comment :)
Just make sure the medal is gold, not silver or bronze.
Will2K, you magnificent bastard! What would we do without you? I just honestly wanna say thank you for demystifying some of the most unintuitive and downright backwards inner workings of the Source engine (as well as your screenshot tutorial - also pretty useful). You deserve a medal.