Closed frideal closed 6 years ago
Texture2D.ReadPixels(); about 50ms
public static void fcLock(RenderTexture src, TextureFormat dstfmt, Action<byte[], fcPixelFormat> body) { var tex = new Texture2D(src.width, src.height, dstfmt, false); RenderTexture.active = src; tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false); tex.Apply(); body(tex.GetRawTextureData(), fcGetPixelFormat(tex.format)); UnityEngine.Object.Destroy(tex); }
In the Profiler I found that the bottleneck of GenericFrameRecorder is ReadPixels (about 50ms - 60ms).
at the moment, the recorder do not use async read back from the grafics card, so yes recording has a significant impact on frame rate.
thanks for your reply.
Dose GenericFrameRecorder Use Multi thread when Output 4K Mp4 file?
When I upgrade My computer device config:
Window10 64 bit Intel Core i9-7900 @ 3.30GHZ 525GB ssd Gtx 1080 ti 11GB
The Recorder process always output about 10fps (My scene just contains just One character)