VRM: Difference between revisions
SirYodaJedi (talk | contribs) (Created page with "{{stub}} '''VRM''' is a model file format supported by {{src}} StudioMDL. It was developed as a successor to SMD, but ultimately was scrapped in favor of sticking with...") |
mNo edit summary |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
'''VRM''' is a model file format supported by {{src}} [[StudioMDL]]. It was developed as a successor to [[SMD]], but ultimately was scrapped in favor of sticking with [[SMD]], and | '''VRM''' is a model file format supported by {{src}} [[StudioMDL (Source)|StudioMDL]]. It was developed as a successor to [[SMD]], but ultimately was scrapped in favor of sticking with SMD, and later [[DMX]]. The main distinction between the formats is that VRM supports multiple [[LoD]]s in a single file, using [[w:Intel|Intel]]'s proprietary Multi-Resolution Mesh (MRM) technology. | ||
{{confusion|The VRM file extension is also used for an [https://vrm-consortium.org/en/ unrelated VR model format].}} | |||
== Data blocks == | |||
Here are the components of a VRM file, considered in order: | |||
{{note|This document has been written assuming you already know how an [[SMD]] file works.}} | |||
{{warning|This document does NOT (at the moment) detail ANY info on how VRM implements MRM.}} | |||
=== Header === | |||
version 2 | |||
name "<[[string]]|Object Name>" | |||
vertices <[[int]]|Amount of vertices> | |||
faces <[[int]]|Amount of faces> | |||
materials <[[int]]|Amount of materials> | |||
texcoords <[[int]]|Amount of texture coordinates> | |||
normals <[[int]]|Amount of normals> | |||
tristrips <[[int]]|Amount of tristrips> | |||
==== Name ==== | |||
Defines the name for the object, this is ignored by [[StudioMDL (Source)|StudioMDL]]. | |||
==== Vertices ==== | |||
Defines the amount of vertices used in the mesh. | |||
==== Faces ==== | |||
Defines the amount of faces (triangles) used in the mesh. | |||
==== Materials ==== | |||
Defines the amount of materials (textures) used in the mesh. | |||
==== Texcoords ==== | |||
Defines the amount of texture coordinates (UVs) used in the mesh. | |||
: {{warning|This value has to be above 0, as otherwise [[StudioMDL (Source)|StudioMDL]] will crash with an error.}} | |||
==== Normals ==== | |||
Defines the amount of normals used in the mesh. | |||
==== Tristrips ==== | |||
Always 0. | |||
{{note|StudioMDL ignores this, so you *could* use any value you want.}} | |||
=== Nodes === | |||
Works exactly the same as in [[SMD#Nodes|SMD]]. | |||
=== Skeleton === | |||
Works exactly the same as in [[SMD#Skeleton|SMD]]. | |||
=== Vertexlist === | |||
List of vertices. | |||
==== Syntax ==== | |||
; <code>vertexlist</code> | |||
: Begins the block. | |||
; <code><[[int]]|Vertex ID> <[[int]]|Parent bone> <[[float]]|PosX PosY PosZ> <[[int]]|Links> <[[int]]|Bone ID> <[[float]]|Weight> [...]</code> | |||
: Defines a [[vertex]]. | |||
:* <code>Pos</code> is in world [[unit]]s | |||
: The final three values are optional: they override <code><Parent bone></code> to define a series of [[weightmap]] links. <code>Bone ID</code> and <code>Weight</code> are repeated for each link. If the weights do not add up to 1, any remaining value is placed on <code><Parent bone></code>. | |||
; <code>end</code> | |||
: Ends the block. | |||
=== Facelist === | |||
List of faces (triangles). | |||
==== Syntax ==== | |||
; <code>facelist</code> | |||
: Begins the block. | |||
; <code><[[int]]|Face ID> <[[int]]|VertID1 VertID2 VertID3></code> | |||
: Defines a triangle. | |||
; <code>end</code> | |||
: Ends the block. | |||
=== Materiallist === | |||
List of materials. | |||
==== Syntax ==== | |||
; <code>materiallist</code> | |||
: Begins the block. | |||
; <code><[[int]]|Material ID> <[[float]]|ARed AGreen ABlue AAlpha> <[[float]]|DRed DGreen DBlue DAlpha> <[[float]]|SRed SGreen SBlue SAlpha> "<[[string]]|Texture Path>"</code> | |||
: Defines a material. | |||
; <code>end</code> | |||
: Ends the block. | |||
=== Texcoordlist === | |||
List of texture coordinates (UVs). | |||
==== Syntax ==== | |||
; <code>facelist</code> | |||
: Begins the block. | |||
; <code><[[int]]|Texture coordinate ID> <[[float]]|U V></code> | |||
: Defines a texture coordinate. | |||
; <code>end</code> | |||
: Ends the block. | |||
=== Normallist === | |||
List of normals (normal vectors). | |||
==== Syntax ==== | |||
; <code>normallist</code> | |||
: Begins the block. | |||
; <code><[[int]]|ID> <[[int]]|Bone ID> <[[float]]|NormX NormY NormZ></code> | |||
: Defines a normal. | |||
; <code>end</code> | |||
: Ends the block. | |||
=== Faceattriblist === | |||
List of faces, again, but now with extra attributes. | |||
==== Syntax ==== | |||
; <code>facelist</code> | |||
: Begins the block. | |||
; <code><[[int]]|Face ID> <[[int]]|Material ID> <[[int]]|Smooth> <[[int]]|TexCoordID1 TexCoordID2 TexCoordID3> <[[int]]|NormID1 NormID2 NormID3></code> | |||
: Defines attributes for a face. | |||
; <code>end</code> | |||
: Ends the block. | |||
== External links == | == External links == | ||
* [https://github.com/Source-SDK-Archives/source-sdk-2004/blob/master/src_mod/utils/studiomdl/mrmsupport.cpp#L680 VRM parser in the Source 2004 SDK] | * [https://github.com/Source-SDK-Archives/source-sdk-2004/blob/master/src_mod/utils/studiomdl/mrmsupport.cpp#L680 VRM parser in the Source 2004 SDK] | ||
* [https://valvearchive.com/articles/vrm/ Article about VRM and 3DS Max plugin on Valve Archive] | |||
* [https://web.archive.org/web/19990910123935/http://sierrastudios.com/games/teamfortress/ TF2 Brotherhood of Arms official website (archived)], which discusses MRM technology | |||
* [https://github.com/UnBeatWaterGH/valve-vrm/blob/main/vrmtosmd.py Python script allowing for VRM to SMD conversion] | |||
[[Category:Plain text formats]] | [[Category:Plain text formats]] | ||
[[Category:File formats]] | [[Category:File formats]] |
Latest revision as of 13:34, 23 March 2025
VRM is a model file format supported by StudioMDL. It was developed as a successor to SMD, but ultimately was scrapped in favor of sticking with SMD, and later DMX. The main distinction between the formats is that VRM supports multiple LoDs in a single file, using Intel's proprietary Multi-Resolution Mesh (MRM) technology.

Data blocks
Here are the components of a VRM file, considered in order:


Header
version 2 name "<string|Object Name>" vertices <int|Amount of vertices> faces <int|Amount of faces> materials <int|Amount of materials> texcoords <int|Amount of texture coordinates> normals <int|Amount of normals> tristrips <int|Amount of tristrips>
Name
Defines the name for the object, this is ignored by StudioMDL.
Vertices
Defines the amount of vertices used in the mesh.
Faces
Defines the amount of faces (triangles) used in the mesh.
Materials
Defines the amount of materials (textures) used in the mesh.
Texcoords
Defines the amount of texture coordinates (UVs) used in the mesh.
Warning:This value has to be above 0, as otherwise StudioMDL will crash with an error.
Normals
Defines the amount of normals used in the mesh.
Tristrips
Always 0.

Nodes
Works exactly the same as in SMD.
Skeleton
Works exactly the same as in SMD.
Vertexlist
List of vertices.
Syntax
vertexlist
- Begins the block.
<int|Vertex ID> <int|Parent bone> <float|PosX PosY PosZ> <int|Links> <int|Bone ID> <float|Weight> [...]
- Defines a vertex.
Pos
is in world units
- The final three values are optional: they override
<Parent bone>
to define a series of weightmap links.Bone ID
andWeight
are repeated for each link. If the weights do not add up to 1, any remaining value is placed on<Parent bone>
. end
- Ends the block.
Facelist
List of faces (triangles).
Syntax
facelist
- Begins the block.
<int|Face ID> <int|VertID1 VertID2 VertID3>
- Defines a triangle.
end
- Ends the block.
Materiallist
List of materials.
Syntax
materiallist
- Begins the block.
<int|Material ID> <float|ARed AGreen ABlue AAlpha> <float|DRed DGreen DBlue DAlpha> <float|SRed SGreen SBlue SAlpha> "<string|Texture Path>"
- Defines a material.
end
- Ends the block.
Texcoordlist
List of texture coordinates (UVs).
Syntax
facelist
- Begins the block.
<int|Texture coordinate ID> <float|U V>
- Defines a texture coordinate.
end
- Ends the block.
Normallist
List of normals (normal vectors).
Syntax
normallist
- Begins the block.
<int|ID> <int|Bone ID> <float|NormX NormY NormZ>
- Defines a normal.
end
- Ends the block.
Faceattriblist
List of faces, again, but now with extra attributes.
Syntax
facelist
- Begins the block.
<int|Face ID> <int|Material ID> <int|Smooth> <int|TexCoordID1 TexCoordID2 TexCoordID3> <int|NormID1 NormID2 NormID3>
- Defines attributes for a face.
end
- Ends the block.