Hellooo,
I’m working on post-processing effect to draw outlines around objects.
It already works but I’d like to optimize the amount of Blit() calls.
My problem: Blitting from source to source won’t work.
So you have to first blit to a temporary rendertexture…
commandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, tmpRenderTexture);
commandBuffer.SetGlobalTexture("_OutlineTex", outlineTexture);
commandBuffer.Blit(tmpRenderTexture, BuiltinRenderTextureType.CameraTarget, overlayMaterial);
Is there a more elegant / more performant way to do this?
Is there no way to avoid two Blit() calls?
I’m also thinking about drawing the outline texture on a UI.RawImage to avoid both of those Blits. Hm.