VRM: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Consider this a ROUGH(ish) import of my documentation.)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{stub}}
{{stub}}
'''VRM''' is a model file format supported by {{src}} [[StudioMDL (Source 1)|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.
'''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].}}
{{confusion|The VRM file extension is also used for an [https://vrm-consortium.org/en/ unrelated VR model format].}}
Line 24: Line 24:
==== Name ====
==== Name ====


Defines the name for the object, this is ignored by [[StudioMDL (Source 1)|StudioMDL]].
Defines the name for the object, this is ignored by [[StudioMDL (Source)|StudioMDL]].


==== Vertices ====
==== Vertices ====
Line 42: Line 42:
Defines the amount of texture coordinates (UVs) used in the mesh.
Defines the amount of texture coordinates (UVs) used in the mesh.


: {{warning|This value has to be above 0, as otherwise [[StudioMDL (Source 1)|StudioMDL]] will crash with an error.}}
: {{warning|This value has to be above 0, as otherwise [[StudioMDL (Source)|StudioMDL]] will crash with an error.}}


==== Normals ====
==== Normals ====
Line 144: Line 144:
* [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://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]
* [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

Stub

This article or section is a stub. You can help by expanding it.

VRM is a model file format supported by 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 LoDs in a single file, using Intel's proprietary Multi-Resolution Mesh (MRM) technology.

Warning.pngRisk of Confusion:The VRM file extension is also used for an unrelated VR model format.

Data blocks

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

Note.pngNote:This document has been written assuming you already know how an SMD file works.
Warning.pngWarning: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.

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.pngWarning: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.

Note.pngNote:StudioMDL ignores this, so you *could* use any value you want.

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.
The final three values are optional: they override <Parent bone> to define a series of weightmap links. Bone ID and Weight 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.

External links