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 JadeTheFlame · Oct 27, 2015 at 11:58 AM · gameobjectresolutionscaleresolution settings

Stretch Worldspace to Screen Resolution

So oddly enough, I can't find a question on this, so I can't find an answer. It seems quite simple however.

I need my world to scale with the user's resolution. I have an orthographic camera, but changing the resolution instead allows the player to see more of the gameworld. I want a simple boundary that the camera simply stretches to. Is there an option I am missing somewhere? The solution to this seems like it should be nearly script-free.

Comment
Add comment · Show 4
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 JadeTheFlame · Oct 27, 2015 at 06:32 PM 0
Share

O$$anonymous$$, thank you all for your attempts to help me. I would prefer no black edges on my camera space however. Additionally, I will not scale gameobjects. This will mess up several things right off the bat. Take for instance rigidbodies, scripted overlapped circles, particle systems, etc. So much doesn't change when you scale a gameobject.

avatar image npatch JadeTheFlame · Oct 27, 2015 at 06:35 PM 0
Share

The link I sent last doesn't scale game objects but the rendered image of the texture supposedly. So I'd try to learn more from the people in there or search on my own on how that can be done. From what I understand they use the rendertexture in a kind of post processing way.

avatar image JadeTheFlame npatch · Oct 27, 2015 at 08:42 PM 0
Share

I know exactly what they are doing. I will not re-size anything instanced. If it applies to the whole project - no if the ONLY way the solution works is on the entire scene rendering, then it is the proper solution. If the solution can be controlled to a per-instance method, then it is incorrect.

Check out this https://youtu.be/r$$anonymous$$CLWt1DuqI?t=2190. Notice before he makes the correction for an ipad, aka as it is on the iphone (640x1136), there is a significant amount of space above the building. It is a lot of grey matter in his scene, but in $$anonymous$$e, it is very important that this area remains as is. Once he scales down to the ipad, you can see the width adjusts to the value he wants, however there is far less grey matter, important objects that get lost.

Now, as far as rendered image of the texture, there are two problems with this: 1) If you are referring to render to texture methods, this requires a pro-license. I'd like this solution to be accessible by all users. 2)This method would work, for pro-users that is, only if they did not use multiple cameras overlapping with different render-depths, which is a common feature in many 2D games that have parallax utility or any other background/foreground.

Show more comments

4 Replies

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

Answer by JadeTheFlame · Oct 31, 2015 at 06:17 AM

I just want to say thank you especially @npatch, through our conversing, I have realized it is as simple as one of your comments implies. Render to texture has been made free for all. The trick is to use multiple cameras and render them to the same target texture, and then stretch that texture to the camera when the user changes by reading the screen dimensions. You simply have to keep the texture resolution high to not lose data. Thank you.

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 npatch · Oct 31, 2015 at 07:22 AM 0
Share

Glad you found your solution man

avatar image
2

Answer by npatch · Oct 27, 2015 at 01:25 PM

You probably used the wrong words in your search. Scaling 2d sprites by screen res

or

How To Resize Sprite GameObjects To Fit Different Resolutions?

Not sure but you could also try using the Canvas since it has a Canvas Resize script for such cases. You can set it to work with Full HD res and then scale down for better results instead of trying to scale up which is worse.

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

Answer by starikcetin · Oct 27, 2015 at 05:19 PM

The only proper way i know to do this is to add black parts on sides of screen.

1- You should choose a safe aspect ration (that is, usually 3:2 on android when you only use landscape)

2- Detect the floaded areas by stretching this aspect ratio to fit one side to corresponding side of screen.

3- Simply make that areas black.

So even user's monitor gets bigger or aspect ratio changes, users will see the same thing with different sizes.

Comment
Add comment · Show 5 · 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 npatch · Oct 27, 2015 at 05:23 PM 0
Share

Thing is he wants resizing of everything and that's a difficult subject,which is why there's no easy answer. Even Unity's UI resizes every ui element with screen size on runtime.

avatar image JadeTheFlame · Oct 27, 2015 at 05:54 PM 0
Share

You see that's a solution that I considered. But that seems kind of lazy doesn't it? Honestly, do any of us want to release a game with black bars on the side? You're the first to actually get what my request is about, I'll give you props for that.

avatar image starikcetin JadeTheFlame · Oct 27, 2015 at 08:11 PM 1
Share

Yes, this method destroys the game feeling. I'm currently looking for another solution too, for my own game. $$anonymous$$ay be we can request a "stretching the output render" option from unity itself, like any other game does to deal with aspect ratios.

avatar image JadeTheFlame starikcetin · Oct 27, 2015 at 08:22 PM 0
Share

I think you are correct. If you submit something to the devs let me know, I will fully support it.

Show more comments
avatar image
1

Answer by Ashkan_gc · Oct 27, 2015 at 05:31 PM

If you don't want to resize all elements then the only thing coming to my mind is changing orthographic size. basically the size is half of the height which will be visible so size of 4 means 4 meters will be visible. if you want it to change based on the ratio of the width and height of the screen, you can have a script which changes it, so you don't show the same amount of content in all ratios but the height will be proportional to your width/height ratio. I don't know if it is desirable in your case or not however.

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 JadeTheFlame · Oct 27, 2015 at 05:52 PM 0
Share

Nope, I can change the size of the camera all day long so that the height or the width fit a certain area. Either way, one gets cut out. If I change the height, the width never stays constant, and vice versa. What I need, if you like examples, is for that screen with a height of 4 and a width of 6, render the exact same objects in veiw when the aspect ratio changes from 4:6 to 4:5. If you need me to be even $$anonymous$$ORE specific. Lets say there is an object on the left of my screen and one at the right of my screen. I need both of them in the camera. Now the user changes his resolution, and because the height remains the same, but the width changes, the user cannot see either object. I need the worldspace to STRETCH, or I need a SPECIAL CA$$anonymous$$ERA.

avatar image npatch JadeTheFlame · Oct 27, 2015 at 06:07 PM 0
Share

http://forum.unity3d.com/threads/rendering-at-a-lower-resolution.205587/#post-1490214

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

6 People are following this question.

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

Related Questions

How to handle mobile resolutions without a headache? 0 Answers

How can i access all the GameObjects in the scene? 1 Answer

Edit multiple assets at the same time? 2 Answers

problem with building my game 1 Answer

UI scaling issues 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