My main camera has a script attached to it that sets its targetTexture to mainRT.
Whatever the camera sees is rendered to it.
Then, I blend another RT particlesRT via Graphics.Blit(particlesRT, mainRT, blendMaterial); in OnPostRender()
I want to blit the resulting mainRT to the screen. Going by Unity’s documentation, I thought using null for the destination render texture would do it, i.e.,
Graphics.Blit(mainRT, null as RenderTexture);
I tried using it in both OnPostRender and OnRenderImage.
I end up with a blank screen in both cases. When I comment out OnRenderImage, I see that things are blended nicely into mainRT. But the blit to screen doesn’t work. When OnRenderImage exists (i.e., the function isn’t commented), chaos happens, and mainRT seems to have been cleared.
Can I not blit a camera’s render texture to screen?