Because the amount of pixels need to render is huge, post processing is heavy on performance already. Now each Graphics.Blit requires an extra 0.14ms with 4x MSAA enabled? From profiler I see Unity is using rendertextures named “ImageEffects Temp” to do each process, is it really necessary? I thought only the VR camera needs resolve once after rendering the scene, after that, post effects only process the “resolved” rendertexture, and no more multisampling involved. So maybe each rendertexture “ImageEffects Temp” should be created setting aa to 1(disabled)?
In non-VR rendering, Graphics.Blit triggers Camera.AAResolve->RenderTexture.GrabPixels, killing framerate as well. But in that case I can create temporary rendertextures and set Camera.targetTexture to it, and manually render each frame without OnRenderImage, this is a workaround. But in VR, this method no longer works. I wonder if there’s any feasible workaround approaches in VR, thanks.
Well, I think I’ve figured out how Unity internally handles post processing in VR rendering (Single Pass Stereo).
When you use “OnRenderImage(RenderTexture source, RenderTexture destination)”, Unity internally creates a RenderTexture “ImageEffects Temp” as the “source”, and its antialiasing property is set to your current “QualitySettings.antiAliasing”, and this “source” is created even if you do nothing in “OnRenderImage”.
If you ever use Graphics.Blit(“whatever”, destination) in “OnRenderImage”, Unity internally creates RenderTexture “RTEyeTextureDoubleWide” as the “destination”, and its antialiasing property is set to your current “QualitySettings.antiAliasing” as well. This one will eventually sent to HMD I think.
Graphics.Blit->RenderTexture.ResolveAA will occur on both “source” and “destination” because their antialiasing type. The resolve on “source” is unavoidable, because you need to multisample your render result to get the rendertexture your camera just rendered. About the resolve on “destination”, I doubt if that is truly necessary.
If you have several post processing script, with “OnRenderImage” on each one of them, there will be a lot of “RenderTexture.ResolveAA”, most of which to me are unnecessary. To avoid that overhead, you can just use a single post processing script with only one “OnRenderImage”, and you creates your own rendertextures with antialiasing disabled, and you can then use Graphics.Blit(rt1, rt2) as many times as you wish. This can guarantee that only two “RenderTexture.ResolveAA” in total will occur, one for “source”, one for “destination”.