How to render to an offscreen buffer while the application doesn't have focus

I'm trying to render stuff to an offscreen buffer in situations where the application is not the focused application.

In Unity, the rendering loop seems to pause when the application loses focus, which prevents me from rendering to an offscreen buffer.

The question is this: Is there any way to have the rendering loop proceed when the application loses focus?

To give more context I'm explaining next what I'm trying to do. I wan't to print some screens generated with Unity. For that sake I'm using an external application spawned from the Unity app which communicates through redirection of its standard input and output. When the external application starts, it opens the native printing dialog, and in that moment the Unity application loses focus.

In a first attempt, I was generating all the images before opening the printing dialog. But it took so much time to generate the images, that I preferred to have the user fiddle with the printing options before the rendering of the images completed. Is this possible to do? Or for some reason Unity cannot render stuff if it is not the focused app?

there is a settings in edit/project settings/player caleed "run in background" if you check this check box then your unity app will run in background and will execute all codes including rendering loop.

Perhaps too basic of an answer... but do you have Run In Background checked off on Project Settings, Player? If not, then all the game execution stops when it does not have focus. If that is checked, then I don't have an answer beyond that, unfortunately.