Visleaf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(misleading, mat_wireframe not a useful tool for visualizing leaf cuts.)
Line 7: Line 7:
Visleafs are generated automatically from the [[BSP|BSP tree]] by the [[vvis|VVIS]] compile tool. Each (internal) surface of a visleaf is either a [[World brush]] surface or a ''Portal'' to an adjacent visleaf.  
Visleafs are generated automatically from the [[BSP|BSP tree]] by the [[vvis|VVIS]] compile tool. Each (internal) surface of a visleaf is either a [[World brush]] surface or a ''Portal'' to an adjacent visleaf.  


== Examination ==


==Examination==
Using the [[Developer Console]], <code>[[mat_leafvis]] 1</code> draws a red wireframe box around the Player's current visleaf, which is redrawn each time a new visleaf is entered.
You can examine visleaves in the following ways:


* If you own the [[Orange Box]], you can access Hammer's {{key|Map > Load Portal File}} feature. (Leaf edges that touch other edges will be displayed as thick blue lines.)
* With [[Orange Box]] and later games, you can access Hammer's '''Map > Load Portal File''' feature. (Leaf edges that touch other edges will be displayed as thick blue lines.)
* You can use the [[glview]] tool.
* Visleaves can also be examined from the desktop with the [[glview]] tool.
* You can change [[console variable]]s through the [[Developer Console]]. (Entering "'''<code>[[mat_wireframe]] 3</code>'''" will display all rendered leaves, and "'''<code>[[mat_leafvis]] 1</code>'''" will report information about the camera's current visleaf in the [[Developer Console]].)


==See also==
== See also ==


*[[PVS]] (Potentially Visible Set): the 'cluster' of visleaves that are currently being drawn
*[[PVS]] (Potentially Visible Set): the 'cluster' of visleaves that are currently being drawn

Revision as of 14:15, 17 February 2011

A sample scene with two rooms.
The default visleaf structure for the above scene. Note how leaf 2 cannot see leaf 3.

Each visleaf (sometimes referred to simply as a leaf) is a hollow volume in a map which defines a 'cluster' of visible surfaces. Every visible surface of a map is part of one visleaf or another. Visleafs are used primarily by the Rendering Engine to determine (before rendering each frame) which areas of the map might need to be rendered on screen. When any part of a visleaf is potentially visible from any part of the current visleaf, the entire contents of that visleaf are considered for rendering.

Visleafs are generated automatically from the BSP tree by the VVIS compile tool. Each (internal) surface of a visleaf is either a World brush surface or a Portal to an adjacent visleaf.

Examination

Using the Developer Console, mat_leafvis 1 draws a red wireframe box around the Player's current visleaf, which is redrawn each time a new visleaf is entered.

  • With Orange Box and later games, you can access Hammer's Map > Load Portal File feature. (Leaf edges that touch other edges will be displayed as thick blue lines.)
  • Visleaves can also be examined from the desktop with the glview tool.

See also

Template:Otherlang:en Template:Otherlang:en:ru