Class RenderInstanceContainer
Represents a container for render instances.
public class RenderInstanceContainer : IGraphicsResource
- Inheritance
-
RenderInstanceContainer
- Implements
- Inherited Members
Constructors
RenderInstanceContainer()
Creates a new instance of the RenderInstanceContainer class.
public RenderInstanceContainer()
Properties
ExtraInstanceBuffer
The buffer for the extra instance data.
public int ExtraInstanceBuffer { get; set; }
Property Value
InstanceVAO
The Vertex Array Object (VAO) for the instance container.
public int InstanceVAO { get; set; }
Property Value
Instances
The list of render instances in the container.
public List<RenderInstance> Instances { get; set; }
Property Value
IsInitialized
Gets a value indicating whether the object has been initialized and is ready for use.
public bool IsInitialized { get; }
Property Value
Mesh
The mesh associated with the instance container.
public Mesh Mesh { get; set; }
Property Value
TransformInstanceBuffer
The buffer for the model matrix of the instances.
public int TransformInstanceBuffer { get; set; }
Property Value
UVInstanceBuffer
The buffer for the UV transform data of the instances.
public int UVInstanceBuffer { get; set; }
Property Value
Methods
AddInstance(Transform, bool)
Adds a new instance to the container.
public int AddInstance(Transform transform, bool visibility)
Parameters
Returns
Dispose(IRenderDevice)
Releases all resources used by the current instance and performs cleanup using the specified render device.
public void Dispose(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device to use for releasing resources. Cannot be null.
FreeCPUResources()
Releases any CPU resources that are currently allocated by the component.
public void FreeCPUResources()
Remarks
Call this method when the component no longer needs to perform CPU-intensive operations to allow the system to reclaim resources. After calling this method, the component may not be able to perform certain operations until resources are reallocated.
GetInstancesBuffers()
Gets the model matrices and extra data for the instances in the container.
public (Matrix4[], Vector4[], Vector4[]) GetInstancesBuffers()
Returns
Init(IRenderDevice)
Initializes the current instance using the specified render device.
public void Init(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device to use for initialization. Cannot be null.