gpu_extras submodule (gpu_extras.batch)

gpu_extras.batch.batch_for_shader(shader, type, content, *, indices=None)

Return a batch already configured and compatible with the shader.

Parameters
  • shader (gpu.types.GPUShader) – shader for which a compatible format will be computed.

  • type (str) – “‘POINTS’, ‘LINES’, ‘TRIS’ or ‘LINES_ADJ’”.

  • content (dict) – Maps the name of the shader attribute with the data to fill the vertex buffer.

Returns

compatible batch

Return type

gpu.types.Batch