Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active December 7, 2018 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/ec77d5a3f8c0ab578e3356aba60c6257 to your computer and use it in GitHub Desktop.
Save baobao/ec77d5a3f8c0ab578e3356aba60c6257 to your computer and use it in GitHub Desktop.
// 座標と色情報を持つ頂点データ
struct VertexData
{
public Vector3 position;
public Vector3 color;
// この頂点データの容量
public static int SizeInBytes => System.Runtime.InteropServices.Marshal.SizeOf(typeof(VertexData));
public static InputElement[] VertexInputElements = new[]
{
new InputElement
{
SemanticName = "SV_Position",
Format = Format.R32G32B32_Float
},
new InputElement
{
SemanticName = "COLOR",
Format = Format.R32G32B32_Float,
// アドレスの自動配置
AlignedByteOffset = InputElement.AppendAligned
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment