A constructor defined in BBMOD_StaticBatch.gml
Implements BBMOD_IDestructible
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.submit, 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 | Struct.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 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 | Enqueues the static batch for rendering. |
start | Begins adding models into the static batch. |
submit | Immediately submits the static batch for rendering. |
modTree = new BBMOD_Model("Tree.bbmod");
var _vformat = modTree.get_vertex_format();
batch = new BBMOD_StaticBatch(_vformat);
batch.start();
with (OTree)
{
var _transform = matrix_build(x, y, z, 0, 0, direction, 1, 1, 1);
other.batch.add(other.modTree, _transform);
}
batch.finish();
batch.freeze();
Copyright © 2024, BlueBurn. Built on September 07, 2024 using GMDoc.