Search Unity

Read back limited data from compute shader?

Discussion in 'Shaders' started by taxfromdk, Jan 23, 2016.

  1. taxfromdk

    taxfromdk

    Joined:
    Oct 30, 2009
    Posts:
    95
    Hi,

    Im trying to build a particle filter on Compute Shaders.

    Im using this example as a basis: http://florian-noirbent.com/blog/en/dx11-particle-engine/

    The basic implementation is working, but I need to read back results from the GPU. I can download all particles but that is highly inefficient as I only need a small subpart of the data.

    How would I go about reading back only a part of the ComputeBuffer?

    Do I create a newer small buffer and let it read the results or is there a way to fetch a part only?

    If the first, how do I figure out what indices to read from?

    Kind regards.

    Jesper