Table of Contents

Class DrawMeshInstanced

Namespace
Bonsai.Shaders
Assembly
Bonsai.Shaders.dll

Represents an operator that draws the specified mesh geometry using instanced rendering, where each array in the sequence stores the per-instance attributes.

public class DrawMeshInstanced : Sink<Mat>
Inheritance
DrawMeshInstanced
Inherited Members

Properties

InstanceAttributes

Gets a collection of instance attributes specifying how to map instance buffer data into per-instance input values in the vertex shader.

public InstanceAttributeMappingCollection InstanceAttributes { get; }

Property Value

InstanceAttributeMappingCollection

MeshName

Gets or sets the name of the mesh geometry to draw.

[TypeConverter(typeof(MeshNameConverter))]
public string MeshName { get; set; }

Property Value

string

ShaderName

Gets or sets the name of the material shader program used in the drawing operation.

[TypeConverter(typeof(MaterialNameConverter))]
public string ShaderName { get; set; }

Property Value

string

Usage

Gets or sets a value specifying the expected usage pattern of the instance buffer data.

public BufferUsageHint Usage { get; set; }

Property Value

BufferUsageHint

Methods

Process(IObservable<Mat>)

Draws the specified mesh geometry using instanced rendering, where each of the matrix data in an observable sequence stores the per-instance attributes.

public override IObservable<Mat> Process(IObservable<Mat> source)

Parameters

source IObservable<Mat>

A sequence of Mat objects representing the per-instance attribute data used to render each instance.

Returns

IObservable<Mat>

An observable sequence that is identical to the source sequence but where there is an additional side effect of scheduling an instanced rendering operation where instance attribute data is drawn from each of the matrices in the sequence.

Process<TVertex>(IObservable<TVertex[]>)

Draws the specified mesh geometry using instanced rendering, where each array in an observable sequence stores the per-instance attributes.

public IObservable<TVertex[]> Process<TVertex>(IObservable<TVertex[]> source) where TVertex : struct

Parameters

source IObservable<TVertex[]>

A sequence of per-instance attribute data used to render each instance.

Returns

IObservable<TVertex[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of scheduling an instanced rendering operation where instance attribute data is drawn from each of the arrays in the sequence.

Type Parameters

TVertex

The type of the array elements used to store the per-instance attributes.