I'm using a geometry shader to generate polygons for my voxel terrain (marching cubes). The data is output into a buffer using the method shown in the article I link to below.
http://msdn.microsoft.com/en-us/library/bb205122%28v=vs.85%29.aspx
Is there any way to somehow extract the vertex data from the buffer, sort of like the inverse operation of this?
struct Vertex
{
float x, y, z;
float tu, tv;
}
Vertex[] data = new[] // this is what I want to get
{
...
};
DataStream stream = new DataStream(bufferSize, true, true);
stream.Write(data);
stream.Position = 0;
buffer = new Buffer(device, stream, description);