stbvox_get_buffer_count function

  1. @Native<Int Function(Pointer<stbvox_mesh_maker>)>(ffi.Pointer<stbvox_mesh_maker>)>()
int stbvox_get_buffer_count(
  1. Pointer<stbvox_mesh_maker> mm
)

Call this to set the buffer into which stbvox will write the mesh it creates. It can build more than one mesh in parallel (distinguished by the 'mesh' parameter), and each mesh can be made up of more than one buffer (distinguished by the 'slot' parameter).

Multiple meshes are under your control; use the 'selector' input variable to choose which mesh each voxel's vertices are written to. For example, you can use this to generate separate meshes for opaque and transparent data.

You can query the number of slots by calling stbvox_get_buffer_count described below. The meaning of the buffer for each slot depends on STBVOX_CONFIG_MODE.

In mode 0 & mode 20, there is only one slot. The mesh data for that slot is two interleaved vertex attributes: attr_vertex, a single 32-bit uint, and attr_face, a single 32-bit uint.

In mode 1 & mode 21, there are two slots. The first buffer should be four times as large as the second buffer. The first buffer contains a single vertex attribute: 'attr_vertex', a single 32-bit uint. The second buffer contains texture buffer data (an array of 32-bit uints) that will be accessed through the sampler identified by STBVOX_UNIFORM_face_data.

Implementation

@ffi.Native<ffi.Int Function(ffi.Pointer<stbvox_mesh_maker>)>()
external int stbvox_get_buffer_count(ffi.Pointer<stbvox_mesh_maker> mm);