Understanding VIS and hint brushes in Q3Map2
Source: http://tremmapping.pbworks.com/Hint brushes are useful when a map has a bend, doorway, or junction where the visibility compiler creates a room-sized region that is too generous. The goal is to help VIS exclude parts of the map that cannot be seen from that region. This guide explains what to look for, where to place a hint, and how to tell whether it helped.
This article concerns maps compiled with Q3Map2, including Q3 BSP maps used by DarkPlaces. Quake 1 and GoldSrc have different map tools and should not be given these instructions verbatim.
What VIS actually decides
During compilation, structural world geometry divides the traversable space into regions connected by portals. VIS works out a potentially visible set (PVS) for each region: other regions that might be seen from somewhere inside it. At runtime, the engine can use that set to reject world geometry before drawing. Its camera frustum and other renderer checks can reject more.
The word potentially matters. If a region wraps around a corner, its PVS may include a room that the player cannot see from their present position. VIS must be conservative: excluding genuinely visible geometry would make it disappear in game.
What a hint brush changes
A hint brush tells Q3Map2 where to prefer a portal split. It does not become a visible wall or block the player's movement. A useful split gives VIS a smaller source region whose possible view is easier to bound. A split in open space, where both sides can see the same geometry, often gains nothing and may add compile work or portal complexity.
Where to put the cutting face
Start with a genuine occluder: a solid corner or wall that already blocks sight. Place a thin hint brush across the open corridor close to that transition. In a Q3Map2 game pack that supplies common/hint and common/skip, put hint on the face where you want the split and skip on the remaining faces. Check your game pack's shader definitions and portal viewer; painting every face as hint can introduce cuts you did not intend.
In a horizontal plan, the intended cut should span the usable opening from one structural boundary to the other. In 3D it should also extend from floor to ceiling, or between other structural boundaries. A short slab can leave a path around, above, or below its intended cut.
A practical test in your map
- Save a baseline. Compile the map with its normal BSP and VIS settings. Confirm there is no leak, then save the portal view and performance readings from the spots you want to improve.
- Inspect the portals. Use your editor's portal viewer or the compiler's portal debug output to find a broad region spanning a bend. A good candidate is a place where a solid wall blocks the view but the current region reaches past it.
- Add one hint cut. Put its hint face across the opening near the corner and use skip on the other faces if supported by the game pack. Keep the brush in world geometry, not a moving entity.
- Compile again with the same settings. Check that a portal appears at the intended plane and that no unexpected portal cuts were added.
- Compare in game. From identical camera positions, compare the renderer's visible surface or triangle counters and the frame time. Also walk through the doorway to ensure nothing visible disappears.
A useful result is measurable. Keep the hint only when it improves visibility or rendering cost in the problem area without creating a worse result elsewhere. Hinting every opening is not an optimization strategy.
Common mistakes
- Hinting without an occluder: if both sides can see the same spaces, a new portal cannot hide them.
- Stopping at a gap: a partial cut may not separate the region as intended.
- Using detail geometry as the wall: small detail brushes generally do not form the structural visibility boundary you need. Make sure the occluding wall is structural.
- Judging by FPS alone: frame time varies for many reasons. Inspect portal placement and visible geometry as well.
- Assuming one recipe fits every compiler: shader names and hint handling vary by game pack and BSP toolchain.
Tags: Q3Map2, mapping, VIS, hint brushes, DarkPlaces
Comments