Click or drag to resize

VertexAttributeSetValue Method (Single, Single, Single, Single)

Specify the value of a generic vertex attribute

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void SetValue(
	float value0,
	float value1,
	float value2,
	float value3
)

Parameters

value0
Type: SystemSingle
The first component value to set.
value1
Type: SystemSingle
The second component value to set.
value2
Type: SystemSingle
The third component value to set.
value3
Type: SystemSingle
The fourth component value to set.
Remarks
Generic attributes are defined as four-component values that are organized into an array. The first entry of this array is numbered 0, and the size of the array is implementation-dependent and can be queried with MaxVertexAttribs.

When less than 4 float-type values are passed, the remaining components will be set to 0, except for the 4th component, which will be set to 1.

A user-defined attribute variable declared in a vertex shader can be bound to a generic attribute index using the constructor VertexAttribute(Program, Int32, String). This allows an application to use descriptive variable names in a vertex shader. A subsequent change to the specified generic vertex attribute will be immediately reflected as a change to the corresponding attribute variable in the vertex shader.

The binding between a generic vertex attribute index and a user-defined attribute variable in a vertex shader is part of the state of a program object, but the current value of the generic vertex attribute is not. The value of each generic vertex attribute is part of current state and it is maintained even if a different program object is used.

An application may freely modify generic vertex attributes that are not bound to a named vertex shader attribute variable. These values are simply maintained as part of current state and will not be accessed by the vertex shader. If a generic vertex attribute bound to an attribute variable in a vertex shader is not updated while the vertex shader is executing, the vertex shader will repeatedly use the current value for the generic vertex attribute.

Note: it is possible for an application to bind more than one attribute name to the same generic vertex attribute index. This is referred to as aliasing, and it is allowed only if just one of the aliased attribute variables is active in the vertex shader, or if no path through the vertex shader consumes more than one of the attributes aliased to the same location. OpenGL implementations are not required to do error checking to detect aliasing, they are allowed to assume that aliasing will not occur, and they are allowed to employ optimizations that work only in the absence of aliasing.

OpenGL API: glVertexAttrib4

See Also