Vis

From Quake Wiki

Revision as of 10:33, 11 January 2010 by Metlslime (talk | contribs) (New page: '''Vis''' is one of the stages of map compiling. It calculates visibility (or PVS) data for a bsp file previously generated by QBSP. With PVS data, the engine need only dr...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Vis is one of the stages of map compiling. It calculates visibility (or PVS) data for a bsp file previously generated by QBSP. With PVS data, the engine need only draw those parts of the level (and those entities) that might be visible from the current player location. This performance optimization was necessary to allow levels as large and as complex as Quake's on the computers of the day. And even today, most games use equivalent systems to allow levels, props, and NPCs to be as detailed as possible.

What Vis Does

Vis uses the portals from the prt file generated by QBSP to calculate visibility. For each visleaf, it calculates which other visleafs are potentially visible from any point within that visleaf. It does this using the portal data, as each visleaf can only see into other visleafs by looking through one or more portals. The final data, which is a series of bits representing whether or not each pair of visleafs can see each other, is then compressed down and saved in the bsp file.

In addition, there are four hard-coded ambient sounds in Quake; one each for sky, water, slime, and lava. Using the PVS data, Vis calculates the appropriate volume level for each of these ambient sounds based on the proximity and visibility of nearby sky and liquid surfaces.

Using Vis

Vis is a command-line tool, generally named vis.exe. You can invoke it from a command prompt, via a shortcut or batch file, or from the "compile" or "build" menus of some level editors.

Command-line options

TODO

Error Messages and Warnings

TODO

Updated Versions

In addition to id Software's official Vis, there have been various unofficial versions that improve on the original or add additional features. For a list of Vis variants, see mapping tools.