Home -> IRenderableNode -> BindVertexInstanceAttribute

Description

The BindVertexInstanceAttribute method is used to bind a vertex attribute as an instance attribute to the renderable. Instance attributes are passed through as normal vertex attributes, but unlike normal vertex attributes they don't vary per vertex, and only advance with each new instance of the object that is drawn when instanced rendering is enabled, as described under the SetInstanceMode method.

ImportantImportant

There's no difference between normal vertex attributes and vertex instance attributes, only the manner in which they are bound is different.

WarningWarning

A vertex attribute can only be bound to a given slot once, cannot be unbound, and cannot be set after an IRenderableNode has been added as a child of an IStateGroupNode.

Usage

SuccessToken BindVertexInstanceAttribute(IVertexAttribute& vertexAttribute, VertexAttributeId shaderAttributeID);

Argument list

vertexAttribute [IVertexAttribute]
The vertex attribute to bind to this renderable as an instance attribute
shaderAttributeID [VertexAttributeId]
The slot to bind this vertex attribute to, as returned by the GetVertexAttributeId method from the IShaderProgram object.

Return value

[SuccessToken]
True if the attribute was successfully bound, false otherwise. An assertion will be raised in debug builds if the result isn't tested.

See also