I would like to save the output of a fragment shader to a texture, so that I can attempt to reuse the data in later shaders. I originally used Graphics.Blit, but the problem I found is that it submits a quad to the shader, and I need to render a mesh.
My current fallback is to use a RWStructuredBuffer to store the colour value. Unfortunately, I have to do this at a per-vertex basis, as I wouldn't know how many fragments there will be. Therefore, if I wanted to reuse the shaded data, it would have lost some accuracy.
So, I would like to know if there is a way to define a rendertexture as the shader target, without using Graphics.blit.
![alt text][1]
This is my current shader.
![alt text][2]
And this is the code initialising and assigning the buffers.
[1]: /storage/temp/96691-buffer-shader.png
[2]: /storage/temp/96692-shadedbuffer-setup.png
↧