2
我目前正在尝试进行自定义顶点声明。XNA 4.0自定义顶点声明
其中一个位置,颜色和整数传递给效果。我有问题确定什么枚举的VertexElementUsage将用于传递一个整数,以及如何确定声明VertexElements时的偏移量?
public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
{
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
new VertexElement(12, VertexElementFormat.Color, VertexElementUsage.Color, 0),
new VertexElement(?, VertexElementFormat.Byte4, ?, 0)
};
(注意?在过去VertexElement)
那VertexElementUsage怎么样? – William 2012-03-03 03:51:20
任何你想要的。在您的HLSL效果中,可以通过您所说的任何用途来访问数据。 – 2012-03-03 03:52:00
例如VertexElementUsage.Position意味着你可以通过“POSITION0”(或类似的,我不使用HLSL很多,但这是使用部分的全部点)在你的效果里面包含的数据 – 2012-03-03 03:52:45