Hey, so this might seem to be a stupid question, but so far after a few days of trying to find this I have found only people who don't know how to do this or people who assume you know how to do this, but no actual explanation.
I am writing a compute shader which I am giving a rendertexture. So far changing the color of the rendertexture works fine. I declare it as a RWTexture2D and set the color for each pixel as a float4.
My problem is that I also need to write to the depth buffer of my render texture too. How do I do this? Is there a way to read and write to the depth part of the rendertexture I am giving to my compute shader?
↧