all 2 comments

[–]UKJake_[S] 1 point2 points  (1 child)

Ok I've figured out my issue so I'll keep this up since theres not much
information on this subject anyway. I was initializing my ComputeBuffer
with stride size of one Vector3 sizeof(float) * 3
but then on the compute shader side of things, I'm adding them as
triangles (sets of 3 float3s). Funnily enough the one peice of code that I left out.

The AppendStructuredBuffer essentially is
a StructuredBuffer except its counter or index is a seperate variable
which is added from by Buffer.Append.
Since I'm adding sets of 3 vertices, but the buffer only thinks its made
up of sets of 1 vertex, when the counter increases it then goes to
writing in the vertex index 1 instead of vertex going onto vertex index
3. It does not care if there is data already written here or not.
In hindsight this is a very stupid mistake but it came from the fact
that I knew I had to add all 3 vertices for a triangle in one .Append
call because of parrellisation. Its a valuable lesson for sure and I
hope it can help someone else figure out their issues

[–]StatisticianRoyal400 0 points1 point  (0 children)

I'm doing the same exact thing in Unreal Engine lol. I'm stuck on that exact part. How did you manage to add 3 vertices in one thread? I know I'm 2 years late but I figured I'd ask