From f008edbe518d0835e5251a2b2a2a96d8706ea36a Mon Sep 17 00:00:00 2001 From: Dennis Timmermann Date: Fri, 15 Nov 2019 16:52:41 +0100 Subject: [PATCH] fix #43 Shifted colors in player fix --- Assets/FFmpegOut/Runtime/FFmpegSession.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/FFmpegOut/Runtime/FFmpegSession.cs b/Assets/FFmpegOut/Runtime/FFmpegSession.cs index 7a614c7..62b0587 100644 --- a/Assets/FFmpegOut/Runtime/FFmpegSession.cs +++ b/Assets/FFmpegOut/Runtime/FFmpegSession.cs @@ -149,7 +149,11 @@ void QueueFrame(Texture source) var rt = RenderTexture.GetTemporary (source.width, source.height, 0, RenderTextureFormat.ARGB32); Graphics.Blit(source, rt, _blitMaterial, 0); - _readbackQueue.Add(AsyncGPUReadback.Request(rt)); + + var platform = UnityEngine.Application.platform; + if (platform == UnityEngine.RuntimePlatform.OSXPlayer || platform == UnityEngine.RuntimePlatform.LinuxPlayer) _readbackQueue.Add(AsyncGPUReadback.Request(rt, 0, TextureFormat.ARGB32)); + else _readbackQueue.Add(AsyncGPUReadback.Request(rt)); + RenderTexture.ReleaseTemporary(rt); }