-
Notifications
You must be signed in to change notification settings - Fork 45
PVS Editing
PVS stands for Potentially Visible Set. It is the set of leaves that any given leaf can see. The player will render all polygons and entities in the leaves marked by their current PVS. By editing a leaf's PVS, you can make more/less of the map visible to the player from that leaf.
A leaf is a convex volume in the map that the player can move around in, defined by the planes in its BSP tree branch. These are visualized in the 3D view as white transparent regions you can click in Leaf selection mode. In the Leaf Graph widget, leaves are what terminate a branch in the BSP and are colored green (empty) or red (solid).
When a leaf is made visible everywhere in the map, the entities inside it are always rendered by clients. This is useful for making things like 3D skyboxes. It's the same idea as an info_overview_point in reverse mode.
- Select the leaf(s) you want to make visible everywhere, then click
Copy as PVS. - Use the box selection tool to select every leaf in the map, right click, then
Apply PVS->Add. - Verify by clicking on any leaf then selecting
Select PVS. This will highlight all other leaves that are visible to the selected leaf.
An overview point is a leaf which can see every other leaf in the map. All entities in the map will be rendered to clients while inside this leaf.
- Use the box selection tool to select every leaf in the map, right click, then
Copy as PVS. - Select the leaf(s) you want to convert to an overview point, then
Apply PVS->Replace. - Verify by clicking on the overview leaf then selecting
Select PVS. This will highlight all other leaves that are visible to the selected leaf.
Running a BSP through the VIS compiler can fix missing faces and improve performance in maps that were compiled without VIS or with -fast VIS. Below is an example of a missing face caused by an old compiler bug.
The VIS compiler requires a Portal file. To generate one, select File -> Export -> Leaf Portals (.prt). Save the file next to the BSP you're editing, then copy a VIS compiler to the same folder. Run the following command to compile:
hlvis.exe -full mapname.bsp
I've tested this with VHLT and ZHLT. VHLT compiled successfully and was able to fix the missing face in the above example (c2a2b1). ZHLT fails with MAX_PORTALS_ON_LEAF or too many points.
In some cases there will still be missing faces. If those faces are attached to leaves, then you can select those leaves and add them to the PVS of the nearby leaves manually. New tools are needed to attach faces to leaves if they weren't before. The Convert to Model feature can be used in the meantime but is a bad solution.