Dear unity community
as I am pretty new to unity I would be happy for some guidance into the right direction.
I use a shader to modify an image sequence in runtime. This shader is applied as a texture to a material. Now I need to access the color values of this texture in a c# script.
my first practical question would be: How do I get the texture from my shader into my c# script? From what I know I could use .GetPixel from there.
Since I am aware of the fact that getting these values from the gpu to the cpu is always a bottleneck, I was wondering whether there is a best practice to do this?
I was thinking about passing the texture to a compute shader and fill a RWStructuredBuffer there and somehow getting the data back from there? Would that be faster?
↧