Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 donnysobonny · Feb 15, 2014 at 12:44 AM · cameratexture2d

Trying to display a screen capture as a loading screen.

Hey guys,

So I'm building an online game. The programming allows players to easily jump through different rooms/server instances in a sort of semi-dynamic way.

I am using Photon to aid in the server programming, and switching between rooms requires that I re-create the player in the new room as his server instantiated object gets destroyed automatically (I've looked at ways of avoiding this to do it manually, however automatic cleaning works much better for what i'm doing).

So, to counter the brief moment that the player model doesn't exist when switching rooms, I am displaying a loading screen. Initially (during early development) I was just displaying a black screen with a "Loading..." image planked ontop, which in my oppinion is very disruptive to the whole experience, so ideally I am trying to look at the option of displaying a screen capture of everything on the screen just before the player's model is destroyed and using that as the loading screen, to make the loading process a little less obstructive.

Things I have tried so far:

1) My first attempt was done by utilizing the way that the camera works. Inititally, I would disable the camera just before the player's model was destroyed and then re-enable it once the new copy is instantiated on the other end, and the screen would display the last frame that was rendered before the camera was disabled. This worked okay sometimes, but most of the time caused weird camera jittering effects, particularly to GUI elements. I spent hours trying to work around this problem and wasn't able to find a solution.

2) The next attempt was pretty similar to the above, except instead of disabling the camera, I set changed the culling and clearing mask to effectively look like the camera had frozen on a frame. This also worked occasionally but had the same problems as in 1).

3) My recent attempt involved storing the screen in a Texture2D object, using the ReadPixels method, and then displaying that as a GUITexture on the screen. This has produced the most solid results so far, however the process occasionally takes longer than I need it to, sometimes causing the texture to not display properly because it hasn't been able to read the pixels quick enough. I would need to be able to display the texture almost instantly at the point that the loading screen should appear, otherwise the whole process wont look smooth.

Is there possibly another way that I could attempt to do this, or am I going to have to go back to displaying an obstructive loading screen?

It would be worth noting that I don't have Unity pro, so RenderTexture isn't available to me =[

Many thanks in advance for any suggestions.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MakeCodeNow · Feb 15, 2014 at 07:09 PM

I hate to be the one to say this, but I think Unity Pro is you're only real option. If speed wasn't a concern, then your 3rd approach would be fine, but that will always be very slow, especially at higher resolutions, older computers, mobile, etc. Given that you want something close to instantaneous, nothing that I can think of will get you there except a RenderTexture.

If you just want to hide the transition, you might consider a screen-glitch type effect, like on an old analog TV, or the same idea but with something more fitting to your art direction. You could do it over the whole screen or just around where the player is/was.

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.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Get WebcamTexture of camera Kudan AR in Unity3D 1 Answer

display a modified texture on Display 1 in place of camera ,Display modified texture on Display 1 instead of original camera image 1 Answer

import video from camera 3 Answers

How to render a camera image to png 1 Answer

Object Placement alignment to background image 2 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