Libraries.Game.Graphics.VertexAttribute Documentation
Inherits from: Libraries.Language.Object
Variables Table
Variables | Description |
---|---|
integer BONE_WEIGHT | |
integer unit | An optional unit/index specifier used for texture coordinates and bone weights. |
integer usage | An integer formed from the bits of the above constants, representing its usage. |
integer componentCount | How many components this attribute has. |
integer COLOR_PACKED | |
integer offset | The offset of this attribute in bytes. Shouldn't be changed by the user. |
integer NORMAL | |
text BONE_WEIGHT_ALIAS | |
text COLOR_ALIAS | |
integer POSITION | |
integer GENERIC | |
integer BINORMAL | |
text POSITION_ALIAS | |
integer TANGENT | |
integer COLOR_UNPACKED | |
text alias | The alias used for this attribute in a ShaderProgram. |
text NORMAL_ALIAS | |
text TEXTURE_COORDINATES_ALIAS | |
boolean normalized | Whether the values are normalized to either -1.0 and 1.0 (signed) or 0 and 1.0 (unsigned) |
text TANGENT_ALIAS | |
text BINORMAL_ALIAS | |
integer TEXTURE_COORDINATES | |
integer type | The OpenGL type of each component, e.g. GL_FLOAT, GL_UNSIGNED_BYTE, etc. |
Actions Documentation
Binormal()
This action will return a new VertexAttribute set with the BINORMAL usage, and with fields set to appropriate values.
Return
BoneWeight(integer unit)
This action will return a new VertexAttribute set with the BONE_WEIGHT usage, and with fields set to appropriate values.
Parameters
- integer unit
Return
ColorPacked()
This action will return a new VertexAttribute set with the COLOR_PACKED usage, and with fields set to appropriate values.
Return
ColorUnpacked()
This action will return a new VertexAttribute set with the COLOR_UNPACKED usage, and with fields set to appropriate values.
Return
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
CustomColorAttribute(text alias)
This helper action produces a new VertexAttribute that describes a custom color vertex attribute. In a shader, this vertex will be a vector4 containing RGBA values between 0 and 1. To set a color value in an input Number32BitArray, use the Color's "EncodeColorAsNumber" action to turn the color into a valid number in the array. Custom attributes will have a usage value of "-1" until they're added into a VertexAttributes object. Once added, they are assigned a unique usage value.
Parameters
- text alias
Return
CustomIntegerAttribute(text alias)
This helper action produces a new VertexAttribute that describes a custom 32-bit integer vertex attribute. Custom attributes will have a usage value of "-1" until they're added into a VertexAttributes object. Once added, they are assigned a unique usage value.
Parameters
- text alias
Return
CustomNormalizedVector4Attribute(text alias)
This helper action produces a new VertexAttribute that describes a "packed" Vector4 vertex attribute. This vertex value can be described as a single number produced by the NumberUtilities' "PackNormalizedVector4" action. In a shader, this represents a Vector4 whose values are all between 0 and 1. This is functionally the same as an attribute produced by the CustomColorAttribute action. Custom attributes will have a usage value of "-1" until they're added into a VertexAttributes object. Once added, they are assigned a unique usage value.
Parameters
- text alias
Return
CustomNumberAttribute(text alias)
This helper action produces a new VertexAttribute that describes a custom 32-bit floating point vertex attribute. Custom attributes will have a usage value of "-1" until they're added into a VertexAttributes object. Once added, they are assigned a unique usage value.
Parameters
- text alias
Return
CustomVectorAttribute(text alias, integer vectorSize)
This helper action produces a new VertexAttribute that describes a custom vector of 32-bit floating point values as a vertex attribute. The vector size should be between 2 to 4. Custom attributes will have a usage value of "-1" until they're added into a VertexAttributes object. Once added, they are assigned a unique usage value.
Parameters
- text alias
- integer vectorSize
Return
Equals(Libraries.Game.Graphics.VertexAttribute attribute)
This action determines if the given VertexAttribute has the same usage, component count, alias, and unit values as this VertexAttribute.
Parameters
Return
boolean:
Equals(Libraries.Language.Object object)
This action determines if the given object is a VertexAttribute with the same usage, component count, alias, and unit values as this VertexAttribute.
Parameters
Return
boolean:
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetKey()
This action will return a unique integer value specifying the usage index and unit of this VertexAttribute.
Return
integer:
Normal()
This action will return a new VertexAttribute set with the NORMAL usage, and with fields set to appropriate values.
Return
Position()
This action will return a new VertexAttribute set with the POSITION usage, and with fields set to appropriate values.
Return
SetAttribute(integer usage, integer componentCount, text alias, integer index)
This action will set the Attribute using the given usage value, component count, alias, and index. Users are encouraged to use one of the provided helper actions to produce attributes with the proper values, e.g. Position or Normal.
Parameters
- integer usage
- integer componentCount
- text alias
- integer index
SetAttribute(integer usage, integer componentCount, integer type, boolean normalized, text alias, integer index)
This action will set the Attribute using the given usage value, component count, and alias. Users are encouraged to use one of the provided helper actions to produce attributes with the proper values, e.g. Position or Normal.
Parameters
- integer usage
- integer componentCount
- integer type
- boolean normalized
- text alias
- integer index
SetAttribute(integer usage, integer componentCount, text alias)
This action will set the Attribute using the given usage value, component count, and alias. Users are encouraged to use one of the provided helper actions to produce attributes with the proper values, e.g. Position or Normal.
Parameters
- integer usage
- integer componentCount
- text alias
SetAttribute(integer usage, integer componentCount, integer type, boolean normalized, text alias)
This action will set the Attribute using the given usage value, component count, alias, and index. Users are encouraged to use one of the provided helper actions to produce attributes with the proper values, e.g. Position or Normal.
Parameters
- integer usage
- integer componentCount
- integer type
- boolean normalized
- text alias
Tangent()
This action will return a new VertexAttribute set with the TANGENT usage, and with fields set to appropriate values.
Return
TextureCoordinates(integer unit)
This action will return a new VertexAttribute set with the TEXTURE_COORDINATES usage, and with fields set to appropriate values.
Parameters
- integer unit
Return
On this page
Variables TableAction Documentation- Binormal()
- BoneWeight(integer unit)
- ColorPacked()
- ColorUnpacked()
- Compare(Libraries.Language.Object object)
- CustomColorAttribute(text alias)
- CustomIntegerAttribute(text alias)
- CustomNormalizedVector4Attribute(text alias)
- CustomNumberAttribute(text alias)
- CustomVectorAttribute(text alias, integer vectorSize)
- Equals(Libraries.Game.Graphics.VertexAttribute attribute)
- Equals(Libraries.Language.Object object)
- GetHashCode()
- GetKey()
- Normal()
- Position()
- SetAttribute(integer usage, integer componentCount, text alias, integer index)
- SetAttribute(integer usage, integer componentCount, integer type, boolean normalized, text alias, integer index)
- SetAttribute(integer usage, integer componentCount, text alias)
- SetAttribute(integer usage, integer componentCount, integer type, boolean normalized, text alias)
- Tangent()
- TextureCoordinates(integer unit)