Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GraphicsBuffer

Create a Graphics Buffer.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Constructor
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GraphicsBuffer(Target, int, int)

Create a Graphics Buffer.
public GraphicsBuffer(GraphicsBuffer.Target target, int count, int stride)

Parameters

target

Specify how this buffer can be used within the graphics pipeline.

count

Number of elements in the buffer.

stride

Size of one element in the buffer. For index buffers, this must be either 2 or 4 bytes.

Remarks

Use GraphicsBuffer.Release to release the buffer when no longer needed.
If the buffer size exceeds the value in SystemInfo.maxGraphicsBufferSize, the constructor raises an exception.
Additional Resources: Graphics.RenderPrimitives.

GraphicsBuffer(Target, UsageFlags, int, int)

Create a Graphics Buffer.
public GraphicsBuffer(GraphicsBuffer.Target target, GraphicsBuffer.UsageFlags usageFlags, int count, int stride)

Parameters

target

Specify how this buffer can be used within the graphics pipeline.

usageFlags

Select what kind of update mode the buffer will have.

count

Number of elements in the buffer.

stride

Size of one element in the buffer. For index buffers, this must be either 2 or 4 bytes.

Remarks

Use GraphicsBuffer.Release to release the buffer when no longer needed.
If the buffer size exceeds the value in SystemInfo.maxGraphicsBufferSize, the constructor raises an exception.
Additional Resources: Graphics.RenderPrimitives.