Hello, I am using the anti-aliasing from the new Unity Post Processing stack because built-in MSAA doesn’t give the quality I need, and the performance hit is not nearly worth the quality gain. In my game I have 3 cameras: bottom UI camera, 3D mesh camera, and top UI camera.
The problem:
I need to anti-alias ONLY the 3D mesh camera, but the effect applies to everything on-screen when this camera finishes rendering and makes UI text look absolutely terrible.
To solve this, I’ve attempted to render the camera to a RenderTexture and blit the results to the screen. Running the post process behaviour will make all pixels in the RenderTexture opaque, which will cause the blit to overwrite output from other cameras.
To solve THIS, I have all objects from my intended camera write to the stencil buffer so I can only blit the pixels that were rendered to before the FXAA was applied. I was not able to apply a post process to a RenderTexture and blit the same texture to the screen on a single camera, so I do the blit on another camera. Before the other camera has a chance to blit, all stencil information is cleared. I’ve even ensured the stencil information does get written to the back buffer and not a renderTexture.
I’m at a dead end, I feel like applying AA to only a single camera should not be this difficult. Does anyone have any ideas? I’d like to avoid having to write my own AA shader, but it’s looking like that may be the only option.