new BBMOD_StaticBatch(_vformat)


A static batch is a structure that allows you to compose static models into a single one. Compared to BBMOD_Model.render, this drastically reduces draw calls and increases performance, but requires more memory. Current limitation is that the added models must use the same single material.


Name Type Description
_vformat BBMOD_VertexFormat The vertex format of the static batch. All models added to the same static batch must have the same vertex format. This vertex format must not contain bone data!


Name Description
add Adds a model to the static batch.
destroy Frees memory used by the static batch. Use this in combination with delete to destroy a static batch struct.
finish Ends adding models into the static batch.
freeze Freezes the static batch. This makes it render faster, but disables adding more models.
render Submits the static batch for rendering.
start Begins adding models into the static batch.


mod_tree = new BBMOD_Model("Tree.bbmod");
var _vformat = mod_tree.get_vertex_format();
batch = new BBMOD_StaticBatch(_vformat);
with (OTree)
    var _transform = matrix_build(x, y, z, 0, 0, direction, 1, 1, 1);
    other.batch.add(other.mod_tree, _transform);

See also

BBMOD_DynamicBatch, BBMOD_Model.get_vertex_format

Copyright © 2020, BlueBurn. Built on November 30, 2020 using GMDoc.