private void SaveRenderTextureToPNG(Texture inputTex, string file) { RenderTexture temp = RenderTexture.GetTemporary(inputTex.width, inputTex.height, 0, RenderTextureFormat.ARGB32); Graphics.Blit(inputTex, temp); Texture2D tex2D = GetRTPixels(temp); RenderTexture.ReleaseTemporary(temp); File.WriteAllBytes(file, tex2D.EncodeToPNG()); } private Texture2D GetRTPixels(RenderTexture rt) { RenderTexture currentActiveRT = RenderTexture.active; RenderTexture.active = rt; Texture2D tex = new Texture2D(rt.width, rt.height); tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0); RenderTexture.active = currentActiveRT; return tex; }