Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 JonPQ · Jan 15, 2018 at 11:48 PM · unity 5renderingbug-perhapsscreen resolution

Screen.SetResolution causes a glitch for 1 frame, any way to avoid it?

I'm on iOS and Android... trying a lower resolution to reduce pixels drawn, but.... there is a big glitch when changing resolution... it shows the last frame rendered shrunk down, for 1 frame, before rendering properly the next frame....

Could probably hide this by fading screen to black or some other plain color then doing the change... but that is a poor solution, and adds extra time into loading sequence....

So, is there a way to call Screen.SetResolution() without a rendering glitch ? (unity 5.6.3 iOS & Droid)

Thanks in advance for any help.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Diukrone · Jan 16, 2018 at 12:54 AM

As you not posted some code, please consider to check the SetResolution API!

View Screen.SetResolution API

Comment
Add comment · Show 1 · 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 JonPQ · Jan 16, 2018 at 01:57 AM 0
Share

no code is required.. its a 1 function call. The problem is with Unity, and is there a solution to avoid the rendering glitch that happens when you try to use the function Screen.SetResolution(width, height);

avatar image
0

Answer by NorthStar79 · Jan 16, 2018 at 06:33 AM

Calling set resolution after frame rendering done will be a solution, I did not tried but i highly suggest you take a look at this documentation page about OnPostRender


EDIT : i think OnPreRender can be a better solution. give it a shot.

Comment
Add comment · Show 4 · 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 JonPQ · Jan 16, 2018 at 04:40 PM 0
Share

Thanks, yep tried OnPostRender, but it takes several frames on older systems... so you see a glitched screen for maybe 1/4 second on Android s3

avatar image NorthStar79 JonPQ · Jan 17, 2018 at 05:24 AM 0
Share

if it takes several frames, I am afraid fade out and fade in is the best way to hide that glitch from the player I guess.

avatar image JonPQ NorthStar79 · Jan 17, 2018 at 08:03 PM 0
Share

Thanks again... trying something like this.... ...wait for end of frame.... ...disable scene cameras (to leave last good rendered screen up) ...change SCreen.SetResolution(w,h) ...optional wait a bit here, or wait for something.... end of frame, pre or post render ? ...then turn cameras back on ...its not working yet but... have hopes...

Show more comments
avatar image
0

Answer by JonPQ · Jan 24, 2018 at 05:00 PM

had to work around... by doing the screen fade in first scene, set camera to not clear, just draw a polygon over whole screen, that fades from alpha 0 to 255 (this fades out the splash screen) and gives a blank screen, then switch res, then wait a few frames, then turn on a new screen below the now opaque poly/sprite/image. then fade the opaque one (which is on top) back down to alpha 0, to reveal the new image, at new resolution.

added a fade to flat color, change res, pause, then un-fade, to reveal scene.

Few things learned though.... did get it working on S3, but S5 showed corruption after turning off all cameras. Also required some odd timing waits, which was deemed unreliable for compatibility. Trying the setResolution in preRender or PostRender would crash some droid devices.

Update:- Since release of iPhone X and tall aspect devices with no home button... the home button has migrated to in icon at the bottom of the screen instead.. some devices seem to now add extra time into their start-up sequence to fade out the home button. This can also mess with the timing of the above fix, and re-introduce a glitch in display, when swapping resolutions

Comment
Add comment · Show 1 · 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 NorthStar79 · Jan 25, 2018 at 05:20 AM 0
Share

Trying the setResolution in preRender or PostRender would crash some droid devices.

That's odd, I will keep this in $$anonymous$$d, thank you for sharing your progress

avatar image
0

Answer by Vortexboy · Jan 04, 2019 at 09:24 AM

I also encountered the same question.

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

153 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 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 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 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 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 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 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 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 avatar image

Related Questions

Halo rendering through objects? 0 Answers

Objects are not visible until the camera gets closer. 1 Answer

Is it possible to render in Unity without the editor/scene/player being visible? 0 Answers

Unity2D strange green line under sprites 0 Answers

Native rendering plugin D3D11 device type not being set in x86 builds. 0 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