Reputation: 11
As a test im trying to move an animated skinned mesh up and down per vertex but it doesnt really work.
Im fairly certain that the vertices im changing are before the animation is applied. How would I go about changin the vertices after it has been applied
heres my compute shader code
// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel TriangleParticle
RWByteAddressBuffer bufVertices;
RWByteAddressBuffer bufIndices;
StructuredBuffer<float3> bufOldVertices;
float triDist;
float trilerp;
float time;
float3 target;
[numthreads(64,1,1)]
void TriangleParticle (uint3 id : SV_DispatchThreadID)
{
float3 vertPos = bufOldVertices[id.x];
vertPos += float3(0, trilerp, 0);
bufVertices.Store3(id.x * 40, asuint(vertPos));
}
Upvotes: 1
Views: 370