Viewmodel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See also: added viewmodel add mesh tut)
No edit summary
Line 17: Line 17:
* [[Viewmodels in Blender|Creating Viewmodels in Blender]]
* [[Viewmodels in Blender|Creating Viewmodels in Blender]]
* [[Creating worldmodels from viewmodels]]
* [[Creating worldmodels from viewmodels]]
* [[[Weapon ViewModel Implementation Tutorial (for Source Engine])]]


[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 22:40, 16 June 2010

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. The only reason they're not 2D sprites is so they can reflect World lighting (cubemaps). 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