I would like to create cloth simulation. Which type of buffer should i use for vertices. I will need to update them on every frame. And how updates need to be done. I'm new to graphics programming, but still i'm mostly interesting in high level overview. If there is open-source project implementing it, reference to it would be of help.
For now i have only rigid body geometries. For this i create a resource with
THROW_IF_FAILED(g_device->CreateCommittedResource( &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT), D3D12_HEAP_FLAG_NONE, &CD3DX12_RESOURCE_DESC::Buffer(byteSize), D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(buffer_.GetAddressOf())));
Then i update it with initial data using another upload buffer to initialize first buffer. Lastly i transition first buffer into
Well, i got some comments directing me toward DirectX11, but for my purposes i will better use DirectX12, and again, i'm pretty matured programmer and just need a highlevel overview of what need to be done.
create default buffer with geometry, then create upload heap, and when needed create placed resource buffer to upload data into your default buffer.
But here a lot of questions arise. For now i use frame resources e.g. for transforms to update them on each frame and do not stall CPU. But if i will copy once a frame to the same default buffer will my it cause stalling? And should i use different queue for copying, and how then do resource state transitioning?
From what i understood for now, i need to implement this, but how to implement