WiseHINT: HINT Brushes

From Valve Developer Community
Jump to: navigation, search

This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

Definition of HINT Brushes, per Valve:

Hints brushes are non-solid brushes that manually create leaf divisions. Since the entire contents of a leaf are drawn when any part of it is visible, hint brushes can be used to give the compile tools “hints” about how the areas should be split up into leaves.

A hint brush is a single brush with the material tools\toolshint on one or more of its faces. The other faces should have tools\toolsskip applied to them. The brush side(s) with toolshint will be used as a cutting plane for the hint brush. A leaf boundary will be created along that plane when the map is compiled. Multiple hint brushes can be used in a single map, and can even intersect.

Proper usage of hint brushes on large, open levels can dramatically reduce the time it takes for VVIS to compile the level. Large numbers of leaves with lots of detail in them take a long time for the tools to compile. Use hint brushes to divide up the large sections of the level that have no detail from the areas that have lots of detail. A common example is an outdoor map with a canyon that opens to the sky. Placing a horizontal hint brush across the top of the canyon will create a large empty leaf in the sky, and separate it from the leaf with all of the detail (the canyon).

See maps\sdk_hints.vmf for examples of hint brush usage.


HINT Brushes are simple to create but placing them will require you to experiment. For this tutorial I’m going to use Valve’s sdk_hints example file. This file is in your \sourcesdk_content\hl2\mapsrc folder.

We create HINT brushes by making normal world brushes with the tools\toolsskip texture then use the Face Edit tool to apply the tools\toolshint texture to at least one face. Each face with the tools\toolshint texture is where we will ask VVIS to create leaf divisions.

wiseHint01.jpg

wiseHint02.jpg wiseHint03.jpg

The example file uses horizontal hint brushes and a large normal world brush to create leaf divisions.

With: wiseHint04.jpg Without: wiseHint05.jpg

If we compile the map, load it, and type mat_wireframe 1 and mat_leafvis 1 in the game console we will be able to see the current PVS and the current leaf. (Porter's note: See r_lockpvs also.)

Examples

Without a HINT brush: wiseHint06.jpg

With a HINT brush: wiseHint07.jpg

With a HINT brush but the large center brush has been converted to func_detail:

wiseHint08.jpg


Now notice the leaf that was created over the same volume for the area with the barrels:

With horizontal HINT brush: wiseHint09.jpg

Without HINT brush: wiseHint10.jpg

When you create your HINT brushes they do not have to be any certain thickness, in the example used here they are 8 units thick but I got the same effect with them being one unit thick. They can really get in your way while you are working on your map but there are two ways you can control that.

  1. Create a VisGroup for your HINT brushes.
  2. Wait until the BSP portion of your map is finished (or mostly finished) then create them.

So where should you create your HINT brushes? Review the information elsewhere on the wiki, and look at your map with a creative eye, there really is no simple answer but you will find your own methods if you experiment. The easiest HINT brush has to be a horizontal HINT brush like the one in the example. Other candidates would be large unused areas of your map, use HINT brushes there to create a “room” with HINT brush “walls”. When the large brush was converted to func_detail in this example what would happen if we placed a vertical HINT brush in front of that one? Try that with the SDK example file.

See also