stamblew
stamblew

Reputation: 148

ReadPixels every frame from specific camera Unity

I am trying to share my screen, but from a specific camera in Unity. By using this approach of copying from a render texture, my app does not work obviously, since I need to do this every frame.

Is there an approach where I can read the pixels - every frame - from a specific camera without hurting the performance so badly?

Upvotes: 0

Views: 472

Answers (1)

Rick Cheng
Rick Cheng

Reputation: 654

This question was answered on Agora slack channel. Posting verified answer here so others can learn about it:

Your crash may be related to creating the RenderTexture buffer each time with Update() or every frame. You should reuse a buffering variable instead. There shouldn't be a performance issue if you handle memory management correctly.

Upvotes: 2

Related Questions