For VertexDeclaration.Color I have data set-up this way:
private Color4 color;public Vector3 Position;public Vector2 texture;public Vector4 additionalData; //special data needed in shader, without shader its uselesspublic static int SizeInBytes{ get { return Vector3.SizeInBytes + Vector2.SizeInBytes + Vector4.SizeInBytes + Vector4.SizeInBytes; }}public static VertexElement[] Declaration{get { VertexElement[] elements = new VertexElement[] { new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0), new VertexElement(0, 12, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), new VertexElement(0, 20, DeclarationType.Float4, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 1), new VertexElement(0, 36, DeclarationType.Color, //with Float4 ok colors in shader, but crash without shader DeclarationMethod.Default, DeclarationUsage.Color, 0), VertexElement.VertexDeclarationEnd};return elements; }}public int Color{get { return this.color.ToArgb(); }set { this.color = new Color4(System.Drawing.Color.FromArgb(value)); }}
Shader work, without shader crash