- Home /
Realtime HD screencapture via ReadPixels?
Hi,
I've been trying to write a plug-in for Unity that will allow me to output the on-screen Unity render to a BlackMagic SDI card. I have everything working, but unfortunately attempting to use Texture2D.ReadPixels()
in OnPostRender()
is very slow ... at 1920x1080 on my Quadro 4000, I'm only getting around 15fps when just that call is isolated, and ideally I would like to have 30+. Even 1280x720 is not fast enough.
Here is a snippet of my code, it's pretty simple:
int width = Screen.width;
int height = Screen.height;
Texture2D tex = new Texture2D(width, height, TextureFormat.ARGB32, false);
tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
tex.Apply();
Is this simply the wrong approach to take? Obviously using a Blackmagic card is going to require me to pull the GPU data off the card and back through the CPU, so I'm guessing that's where the hang-up is.
We have a similar question, but would like to output to two video outputs (fill and key), which might require even more resources. Any new insides?
Your answer
Follow this Question
Related Questions
Getting Real-Time Continuous Audio from the Mic 1 Answer
Pass Clicks Through Camera 2 Answers
Changing custom import settings at RUNTIME 0 Answers