Reputation: 18805
Do Unity 5 shaders have access to the stream output stage in the DX11 pipeline? Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/bb205121%28v=vs.85%29.aspx
I want to compute new vert data in the shader and then output this information to a script for non rendering purposes (relational damage pertained to a mesh after impact).
I am currently using a GPGPU shader to achieve this, however the extra load on the pipeline is not desirable. This can't really change as it is proportionate to the number of verts in the mesh, so I figure that if I could use the stream output stage in the DX11 render pipeline which Unity uses then this could mitigate such load as the vert data will only need to be passed to the GPU once during the rendering stage, instead of twice via the GPGPU shader.
Is this methodology correct, and can I access the stream output stage?
(all scripting is C#)
Upvotes: 0
Views: 813
Reputation: 922
Unfortunately streaming out vertex data from the vertex or geometry shaders is not yet exposed in Unity, so compute shaders are currently your best bet. Unity does use it internally for GPU skinning, though, if it's of any consolation.
Upvotes: 3