This article's documentation is for anything that uses the Source engine. Click here for more information.

VVIS: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(fast mode)
No edit summary
 
(45 intermediate revisions by 32 users not shown)
Line 1: Line 1:
An optional compiling tool that sets the portals on your map. It determines the what must be rendered in a certain area (the [[PVS]]), allowing the game to ignore parts of the map, speeding up rendering.
{{LanguageBar}}
If this process is taking too long, be sure to read up on [[Controlling Geometry Visibility and Compile Times]] on how to reduce [[visleafs]] using [[func_detail]]s.
{{Source topicon}}
{{toc-right}}
{{map compile pipeline|source1}}


The VVIS phase may be run in "fast" mode or omitted entirely to reduce the compiling time of a level, if you wish to take a quick look at how your level looks. It is strongly recommended that it is run in "normal" mode for any final map release. Note that if VVIS is not run, [[water]] will not be appear in the map correctly.
{{vvis|4}} is the [[command-line]] tool that takes a compiled [[BSP]] map and embeds visibility data into it. VVIS tests which [[visleaf|visleaves]] can see each other and which cannot. See [[Visibility optimization]] for a more detailed explanation.
 
VVIS will:
 
* Test visibility between [[visleaf|visleaves]] by [http://www.gdcvault.com/play/1014234/Excerpt-Quake-Postmortem-Optimizing-Level clipping their view planes].
* Enforce a maximum visibility distance, if configured to.
 
{{tip|For {{tf2branch|nt=0|4.1}} games and {{gmod|2}}, [https://ficool2.github.io/HammerPlusPlus-Website/tools.html VVIS++] is now available, which generates the same results as stock VVIS but at an ''order of magnitude'' quicker speed.}}
 
== Syntax ==
 
vvis [options...] <bsp file>
 
For example:
 
"Half-Life 2\bin\vvis.exe" -tmpout sdk_trainstation_01
 
This will generate and embed a visibility chart, writing portal data out to <code>.\tmp\sdk_trainstation_01.prt</code>.


==Options==
==Options==
Use these in combination with [[expert compile mode]] or a batch file:
=== Functions ===
; <code>-fast</code>
: Only do a quick first pass. Does not actually test visibility.
; <code>-radius_override <[[int]]></code>
: Force a maximum vis radius, in [[unit]]s, regardless of whether an [[env_fog_controller]] specifies one.
; <code>-nosort</code>
: Don't sort (an optimization) portals.
; <code>-tmpin</code>
: Read portals from <code>\tmp\<mapname></code>.
; <code>-tmpout</code>
: Write portals to <code>\tmp\<mapname></code>.
; <code>-trace <start cluster> <end cluster></code> {{source_2007|since}}
: Writes a linefile that traces the vis from one cluster to another for debugging map vis.


Use these in combination with [[expert compile mode]] or a batch file:
=== General ===
[[File:32cores16threads.png|300px|thumbnail|right|32 vCore machine running VVIS with only 16 cores used (even though 32 threads were specified)]]
[[File:32cores32threads.png|300px|thumbnail|right|32 vCore machine running VVIS with all cores used (patched vvis used)]]
; <code>-low</code>
: Run as an idle-priority process.
; <code>-threads</code>
: Override the number of CPU threads used. Maximum is 16 threads (32 in {{csgo}}{{slamminsrc}}{{mapbase}}, unlimited in {{tf2}})
:{{Workaround|With a [[Increased_Thread_Limit_for_Compile_Tools|patched vrad_dll]] you can use 32 threads. {{l4d2}} [https://github.com/ficool2/fixtoolthreads fixtoolthreads] is a patch for [[VVIS]] (and [[VRAD]]) that supports ''unlimited'' threads and fixes a thread scaling issue.}}
::{{Note|The above mentioned thread scaling issue has been fixed in {{tf2}},{{csgo}},{{l4d2}},{{gmod}}.}}
:{{Tip|If you know that the compile time will be very long and would rather do something else while waiting, it may be useful to specify a number of threads 1 or 2 lower than what your CPU has. This allows the computer to allocate some more power to other applications, making it less choppy while lighting is being compiled. Keep in mind that this may slightly extend your compile time.}}
; <code>-verbose (-v)</code>
: Turn on verbose output
; <code>-novconfig</code>
: Don't bring up graphical UI on vproject errors.
; <code>-mpi</code>
: Use [[VMPI]] to distribute computations.
; <code>-mpi_pw <[[string]]></code>
: Use a password to choose a specific set of VMPI workers.
; <code>-vproject <string></code>
; <code>-game <string></code>
: Override the [[VPROJECT]] environment variable.
 
== Console Output ==
VVIS prints various information about the compile process to the console. Note that output from older versions of the tool can be different.
; <code>''number'' portalclusters</code>
: The effective number of visleaves in the map (visleaves clustered together with {{Ent|func_viscluster}} count as one).
; <code>''number'' numportals</code>
: The number of portals connecting the the above visleaves.
; <code>BasePortalVis:      0...1...2...3...4...5...6...7...8...9...10 (''time taken in seconds'')</code>
: Rough visibility calculations that are used to trivially weed out unseen areas from the final calculations.
; <code>PortalFlow:         0...1...2...3...4...5...6...7...8...9...10 (''time taken in seconds'')</code>
: Runs the actual visibility algorithm to determine which visleaves can see each other. Not run with <code>-fast</code>.
; <code>Optimized: ''number'' visible clusters (''percentage'')</code>
: Compression of the visibility data.
; <code>Total clusters visible: ''number''</code>
: The total number of occurrences of visleaves being able to see each other in the calculated data.
; <code>Average clusters visible: ''number''</code>
: The average number of leaves you can potentially see from each visleaf.
; <code>Building PAS...</code>
: Calculates the Potentially Audible Set.
; <code>Average clusters audible: ''number''</code>
: The average number of leaves you can potentially hear into from each visleaf.
; <code>visdatasize: ''number''  compressed from ''number''</code>
: Size of the visibility data in bytes. Max size is 16 MB in Source 2013.
 
== See also ==
* [[PRT]]
* [[Visibility optimization]]
 
{{sdktools}}


=Common options=
[[Category:Official Source Tools]]
{|
[[Category:Source 1 BSP compilers]]
! Command || Description
|-
| -v (or -verbose) || Turn on verbose output (also shows more command)
|-
| -fast || Only do first quick pass on vis calculations.
|-
| -mpi || Use VMPI to distribute computations.
|-
| -low || Run as an idle-priority process.
|-
| -vproject (or -game) <directory> || Override the VPROJECT environment variable.
|}
==Other options==
{|
! Command || Description
|-
| -novconfig || Don't bring up graphical UI on vproject errors.
|-
| -radius_override || Force a vis radius, regardless of whether an env_fog_controller specifies one.
|-
| -mpi_pw <pw> || Use a password to choose a specific set of VMPI workers.
|-
| -threads || Control the number of threads vbsp uses (defaults to the # of processors (times 2 for hyperthreading CPU's) on your machine).
|-
| -nosort || Don't sort portals (sorting is an optimization).
|-
| -tmpin || Make portals come from \tmp\<mapname>.
|-
| -tmpout || Make portals come from \tmp\<mapname>.
|}
=See Also=
* [[Vbsp|VBSP]]
* [[Vrad|VRAD]]
[[Category:Tools]] [[Category:Level Design]] [[Category:Glossary]]

Latest revision as of 14:21, 28 August 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

VBSPVVISVRADBSPZIP

VVIS VVIS is the command-line tool that takes a compiled BSP map and embeds visibility data into it. VVIS tests which visleaves can see each other and which cannot. See Visibility optimization for a more detailed explanation.

VVIS will:

Tip.pngTip:For Team Fortress 2 branch TF2 branch games and Garry's Mod Garry's Mod, VVIS++ is now available, which generates the same results as stock VVIS but at an order of magnitude quicker speed.

Syntax

vvis [options...] <bsp file>

For example:

"Half-Life 2\bin\vvis.exe" -tmpout sdk_trainstation_01

This will generate and embed a visibility chart, writing portal data out to .\tmp\sdk_trainstation_01.prt.

Options

Use these in combination with expert compile mode or a batch file:

Functions

-fast
Only do a quick first pass. Does not actually test visibility.
-radius_override <int>
Force a maximum vis radius, in units, regardless of whether an env_fog_controller specifies one.
-nosort
Don't sort (an optimization) portals.
-tmpin
Read portals from \tmp\<mapname>.
-tmpout
Write portals to \tmp\<mapname>.
-trace <start cluster> <end cluster> (in all games since Source 2007)
Writes a linefile that traces the vis from one cluster to another for debugging map vis.

General

32 vCore machine running VVIS with only 16 cores used (even though 32 threads were specified)
32 vCore machine running VVIS with all cores used (patched vvis used)
-low
Run as an idle-priority process.
-threads
Override the number of CPU threads used. Maximum is 16 threads (32 in Counter-Strike: Global OffensiveSlammin' Source Map ToolsMapbase, unlimited in Team Fortress 2)
PlacementTip.pngWorkaround:With a patched vrad_dll you can use 32 threads. Left 4 Dead 2 fixtoolthreads is a patch for VVIS (and VRAD) that supports unlimited threads and fixes a thread scaling issue.
Note.pngNote:The above mentioned thread scaling issue has been fixed in Team Fortress 2,Counter-Strike: Global Offensive,Left 4 Dead 2,Garry's Mod.
Tip.pngTip:If you know that the compile time will be very long and would rather do something else while waiting, it may be useful to specify a number of threads 1 or 2 lower than what your CPU has. This allows the computer to allocate some more power to other applications, making it less choppy while lighting is being compiled. Keep in mind that this may slightly extend your compile time.
-verbose (-v)
Turn on verbose output
-novconfig
Don't bring up graphical UI on vproject errors.
-mpi
Use VMPI to distribute computations.
-mpi_pw <string>
Use a password to choose a specific set of VMPI workers.
-vproject <string>
-game <string>
Override the VPROJECT environment variable.

Console Output

VVIS prints various information about the compile process to the console. Note that output from older versions of the tool can be different.

number portalclusters
The effective number of visleaves in the map (visleaves clustered together with func_viscluster count as one).
number numportals
The number of portals connecting the the above visleaves.
BasePortalVis: 0...1...2...3...4...5...6...7...8...9...10 (time taken in seconds)
Rough visibility calculations that are used to trivially weed out unseen areas from the final calculations.
PortalFlow: 0...1...2...3...4...5...6...7...8...9...10 (time taken in seconds)
Runs the actual visibility algorithm to determine which visleaves can see each other. Not run with -fast.
Optimized: number visible clusters (percentage)
Compression of the visibility data.
Total clusters visible: number
The total number of occurrences of visleaves being able to see each other in the calculated data.
Average clusters visible: number
The average number of leaves you can potentially see from each visleaf.
Building PAS...
Calculates the Potentially Audible Set.
Average clusters audible: number
The average number of leaves you can potentially hear into from each visleaf.
visdatasize: number compressed from number
Size of the visibility data in bytes. Max size is 16 MB in Source 2013.

See also