import Common; import VertexData; import MaterialParameter; struct StaticMeshVertexData { VertexAttributes getAttributes(uint index) { VertexAttributes attributes; attributes.position_MS = positions[index].xyz; #ifndef POS_ONLY attributes.normal_MS = normals[index].xyz; attributes.tangent_MS = tangents[index].xyz; attributes.biTangent_MS = biTangents[index].xyz; for(uint i = 0; i < MAX_TEXCOORDS; ++i) { attributes.texCoords[i] = texCoords[i][index]; } attributes.vertexColor = color[index].xyz; #endif return attributes; } StructuredBuffer positions; StructuredBuffer normals; StructuredBuffer tangents; StructuredBuffer biTangents; StructuredBuffer color; StructuredBuffer texCoords[MAX_TEXCOORDS]; }; layout(set=1) ParameterBlock pVertexData;