Viewmodel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(clean up)
Line 1: Line 1:
[[Image:hl2-1.jpg|thumb|300px|right|The shotgun in the picture is a typical viewmodel.]]
[[Image:hl2-1.jpg|thumb|300px|right|The shotgun in the picture is a typical viewmodel.]]


A '''viewmodel''' is a model, typically a weapon, which is held in the players hands and can only be seen from the first person view. As it doesn't interfere with the rest of the game world, you can think of it as an overlay on the player's screen. In multiplayer, both the [[Creating Characters|player model]] and the [[World Models|world model]] are rendered on players' screens for them to see.
A '''viewmodel''' is a special type of [[model]] used only to represent the player's current weapon in the first-person view. Viewmodels are animated to show the players hands operating the weapon in response to player inputs. Viewmodels have no collision properties or any kind of presence in the World; they exist only as part of the player's HUD. In multiplayer, each [[Player Entity]] and his current weapon are represented to other players using Worldmodels: an npc_model and a w_weapon model respectively.


== Characteristics of viewmodels ==  
== Characteristics of viewmodels ==  
[[Image:v_shotgun_hlmv.jpg|thumb|300px|right|The same model seen from another angle]]
[[Image:v_shotgun_hlmv.jpg|thumb|300px|right|The same model seen from another angle]]


* A viewmodel is usually very detailed and uses high resolution textures.
* A viewmodel is usually modelled in high detail and uses high resolution textures with expensive shaders.
* Backfaces of the model that the player isn't going to see are often deleted to increase the performance a little bit.
* Backfaces of the model - that the player isn't going to see - are often deleted to increase the performance a little bit.
* Viewmodels have neither physical properties (like $surfaceprop) nor a $collisionmodel.
* Viewmodels have no physical properties (like $surfaceprop) or a $collisionmodel.
* Usually named with a '''v_''' prefix, whereas its world model starts with '''w_''' - example: ''v_shotgun.mdl'' and ''w_shotgun.mdl''
* Viewmodels are rigged for human handling and animated to a high level of detail.
* The viewmodel version of a weapon is prefixed with '''v_''' to distinguish it from the worldmodel version (used by NPCs) which starts with '''w_'''; eg: <code>v_shotgun.mdl</code> and <code>w_shotgun.mdl</code>.


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

Revision as of 20:52, 4 May 2008

The shotgun in the picture is a typical viewmodel.

A viewmodel is a special type of model used only to represent the player's current weapon in the first-person view. Viewmodels are animated to show the players hands operating the weapon in response to player inputs. Viewmodels have no collision properties or any kind of presence in the World; they exist only as part of the player's HUD. In multiplayer, each Player Entity and his current weapon are represented to other players using Worldmodels: an npc_model and a w_weapon model respectively.

Characteristics of viewmodels

The same model seen from another angle
  • A viewmodel is usually modelled in high detail and uses high resolution textures with expensive shaders.
  • Backfaces of the model - that the player isn't going to see - are often deleted to increase the performance a little bit.
  • Viewmodels have no physical properties (like $surfaceprop) or a $collisionmodel.
  • Viewmodels are rigged for human handling and animated to a high level of detail.
  • The viewmodel version of a weapon is prefixed with v_ to distinguish it from the worldmodel version (used by NPCs) which starts with w_; eg: v_shotgun.mdl and w_shotgun.mdl.

See also