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 bhambhu · Jun 12, 2013 at 10:26 PM · screenpixelorthographic

Problem in working with pixel .

Hello Guys ,

I am creating a game using 3D game objects and orthographic camera . I searched a lot and got info about ScreenToWorld function . But, i want to work with all resolutions.

Following are my problem :--

1) how to set orthographicSize ???

I found that it should be equal to ScreenHeight/2;

If i set it to ScreenHeight/2 , my objects did not get visible . It is visible at orthographic size 5.

2) How to relate the gameobject scale to screen resolutions ???

Please guide me guys .

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 robertbu · Jun 13, 2013 at 12:03 AM

I've seen a number of posts on this issue. First you need to understand what it means. Orthographic size is 1/2 of the vertical size in world units.

  • Create a new scene

  • Move the camera to (0,0,-10) (i.e. looking down the 'z' axis)

  • Create a cube at the origin.

  • Set the ortiographic size to 0.5.

The window will now just display that block. That is it will display a vertical size of 0.5 * 2. It doesn't matter what the resoution of the device you put it on, this size will always have a one-unit block filling the vertical size. As the aspect ratio of the device changes, the width will change, but the vertical display will reamin the same. Different games will handle the changing space on the sides differently.

As for what size to set, I've read different arguments. One experienced developer argues strongly for a size of 1.0. For my projects (and I'm by no means a expert), I like to set the size based on the resolution of one device. I pick one device that I want my app to show best. Then I set the size so that I easily get 'pixel perfect' or 'pixel correct' on that device. That is, I want the graphics on that device to show without stretching or scaling. Typically I do this at 1/100th of the pixel size. For example, I would setup the camera so that if I set the size of a one-unity plane to 10.24 x 5.12, a texture on that plane with a pixel size of 1024 x 512 would be shown without any stretching or scaling.

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

14 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

Related Questions

Orthographic cameras and screen resolutions 1 Answer

How to retain absolute gameobject size in pixels no matter the resolution? 2 Answers

How I get sizeof pixels of object 1 Answer

screen position of element in layout 1 Answer

How do i use raycast from a screen point to set a pixels color? -1 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