Garry's Mod Wiki

Revision Difference

Structures/MeshVertex#561021

<structure> <realm>Shared</realm> <description>Table structure representing a mesh vertex used by various functions, such as <page>IMesh:BuildFromTriangles</page> and <page>Entity:PhysicsFromMesh</page> and returned by functions such as <page>util.GetModelMeshes</page> and <page>PhysObj:GetMesh</page>.</description> <fields> <item name="color" type="table">The vertex color. Uses the <page>Color</page>.</item> <item name="normal" type="Vector">The triangles normal required to calculate lighting(optional).</item> <item name="tangent" type="Vector">The triangles tangent. Not used by the VertexLitGeneric shader.</item> <item name="binormal" type="Vector">The triangles binormal. Not used by the VertexLitGeneric shader.</item> <item name="normal" type="Vector">The triangles normal required to calculate lighting (Optional).</item> <item name="tangent" type="Vector">The triangles tangent. Not used by the `VertexLitGeneric` shader.</item> <item name="binormal" type="Vector">The triangles binormal. Not used by the `VertexLitGeneric` shader.</item> <item name="pos" type="Vector">The vertex position.</item> <item name="u" type="number">The u texture scale.</item> <item name="v" type="number">The v texture scale.</item> <item name="u" type="number">The U texture coordinate.</item> <item name="v" type="number">The V texture coordinate.</item> <item name="u1" type="number" added="2024.02.28">The secondary U texture coordinate. Only works when passed to <page>IMesh:BuildFromTriangles</page>, Useful for `LightmappedGeneric` shader.</item>⤶ <item name="v1" type="number" added="2024.02.28">The secondary V texture coordinate. Only works when passed to <page>IMesh:BuildFromTriangles</page>.</item>⤶ <item name="userdata" type="table">A table of four numbers. This is used by most shaders in Source to hold tangent information of the vertex ( tangentX, tangentY, tangentZ, tangentHandedness ).</item> </fields> </structure>