• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Facundo · Apr 23, 2010 at 03:08 PM ·

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by x4000 · Apr 23, 2010 at 07:11 PM

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Facundo · Apr 23, 2010 at 11:20 PM 0
Share

Exactly what I needed guys. Thanks a lot! Fortunately this option can be adjusted also from runtime. See Application.runInBackground: http://unity3d.com/support/documentation/ScriptReference/Application-runInBackground.html

avatar image DeveshPandey · Jan 21 at 11:23 AM 0
Share

what is the solution if target platform is Android??

avatar image
1

Answer by Ashkan_gc · Apr 23, 2010 at 07:10 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

When you use anti-aliasing on android bottom of the texture is cut. 0 Answers

How much do I need to optimize off-screen objects? 2 Answers

How to prevent a fullscreen application from minimizing 4 Answers

Is there any way to find out when an application is on focus? 2 Answers

Web Player ignore input if doesn't have focus 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges