how can we setdata in computebuffer?

I have a struct SCircle like below:

public struct SCircle {
    public float m_radius;
    public Vector2 m_position;
}

and would like to setdata only one instance of it but I can’t because setdata needs an array!
m_computeBuffer.SetData
plz help thank you

I got it thank you

sharing is caring

2 Likes

In this repository you can find various shaders, look for files with *.compute extension and related with them *.cs scripts.

Also check “FLD” directory and “ProceduralGeometry.cs”