#Transform native array into compute buffer

1 messages · Page 1 of 1 (latest)

hallow tendon
#

How can I transform a nativearray<Vertex> where Vertex is {float3 position, normal} into a compute buffer that contains only the position value?

trim marsh
#

ComputeBuffer.BerginWrite<float3> will give you NativeArray<float3> then you should do something like vertexArray.Reinterpret<float3> and then copy one to another like NativeArray<float3>.Copy(posArray, 0, computeBufferArray, 0, posArray.Length). Finally ComputeBuffer.EndWrite<float3>