Search Unity

Access to structuredBuffer from vertex/fragment shader directly

Discussion in 'Shaders' started by mahdiii, Feb 21, 2017.

  1. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    I would like to move many balls using compute shader.So I send my data to gpu (compute shader) and change the positions of them and then send from gpu to cpu to draw them in new positions.(getdata() and drawmeshinstance)
    but getdata() function is slow. How can I draw them without using getdata() and drawmeshinstance (with vertex/fragment shader directly)
    Thanks in advance
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
  3. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    cool perfect
    but why did unity introduce it so late?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Considering they only just added basic instancing in 5.4, a feature that was requested for several years, your guess is as good as anyone's.