Mesh:attachAttribute

Mesh:attachAttribute

Available since LÖVE 0.10.0
This function is not supported in earlier versions.

Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.

Function

Synopsis

Mesh:attachAttribute( name, mesh )

Arguments

string name
The name of the vertex attribute to attach.
Mesh mesh
The Mesh to get the vertex attribute from.

Returns

Nothing.

Notes

If a Mesh wasn't created with a custom vertex format, it will have 3 vertex attributes named VertexPosition, VertexTexCoord, and VertexColor.

Custom named attributes can be accessed in a vertex shader by declaring them as attribute vec4 MyCustomAttributeName; at the top-level of the vertex shader code. The name must match what was specified in the Mesh's vertex format and in the name argument of Mesh:attachAttribute.

See Also

© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/Mesh:attachAttribute

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部