BBMOD_VertexFormat

constructor

new BBMOD_VertexFormat([_confOrVertices[, _normals[, _uvs[, _colors[, _tangentw[, _bones[, _ids]]]]]]])

Description

A wrapper of a raw GameMaker vertex format.

Arguments

Name Type Description
_confOrVertices Struct, Bool Either a struct with keys called after properties of BBMOD_VertexFormat and values true or false, depending on whether the vertex format should have the property, or true, since every vertex format must have vertex positions.
_normals Bool If true then the vertex format must have normal vectors. Defaults to false. Used only if the first argument is not a struct.
_uvs Bool If true then the vertex format must have texture coordinates. Defaults to false. Used only if the first argument is not a struct.
_colors Bool If true then the vertex format must have vertex colors. Defaults to false. Used only if the first argument is not a struct.
_tangentw Bool If true then the vertex format must have tangent vectors and bitangent signs. Defaults to false. Used only if the first argument is not a struct.
_bones Bool If true then the vertex format must have vertex weights and bone indices. Defaults to false. Used only if the first argument is not a struct.
_ids Bool If true then the vertex format must have ids for dynamic batching. Defaults to false. Used only if the first argument is not a struct.

Properties

Name Description
Bones If true then the vertex format has vertex weights and bone indices.
Colors If true then the vertex format has vertex colors.
Ids If true then the vertex format has ids for dynamic batching.
Normals If true then the vertex format has normal vectors.
Raw The raw vertex format.
TangentW If true then the vertex format has tangent vectors and bitangent sign.
TextureCoords If true then the vertex format has texture coordinates.
TextureCoords2 If true then the vertex format has a second texture coordinates layer.
Vertices If true then the vertex format has vertices. Should always be true!

Methods

Name Description
get_byte_size Retrieves the size of a single vertex using the vertex format in bytes.
get_hash Makes a hash based on the vertex format properties. Vertex buffers with same propereties will have the same hash.
Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on November 16, 2022 using GMDoc.