Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

how can we setdata in computebuffer?

Discussion in 'Shaders' started by mahdiii, Apr 28, 2017.

  1. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    I have a struct SCircle like below:
    Code (CSharp):
    1. public struct SCircle {
    2.     public float m_radius;
    3.     public Vector2 m_position;
    4. }
    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
     
  2. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    I got it thank you
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    sharing is caring
     
    pencil1 and ChristopherKerr like this.
  4. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    327
  5. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    327
    Also check "FLD" directory and "ProceduralGeometry.cs"