• 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 AntLewis · Jul 09, 2014 at 12:36 PM · orthographicimporter

Orthographic Size and Pixel to Units

Hi guys, I know there are a ton of Orthographic questions on here already, I’ve read a good deal of them and they’re all pretty straightforward and consistent in their advice. However, there's a couple of points which are unclear to me.

Here’s what I’m doing:

  1. So your Orthographic camera size determines how many world units in the top half of the screen, so an Orth Size of ‘10’ means the screen can display 20 world units in height;

  2. In my test scene, I want my sprite to be 64x64. The original size of the sprite is 256x256, so I imported it and in the importer set the max size to 64 and pixel to units to 64 (as I have 10 world units high based on my orth size, I should be able to stack 10 of these purple sprites)

alt text

The sprite seemed much larger than I anticipated (see screen below), so I tried again, using a red sprite but this time scaled it's source texture down to 64x64. I then set its max size to 64 and pixel to units to 64. As you can see from the screenshot below, this is what I was after.

So here are my questions

  1. I'm not sure if I'm misunderstanding the importer, but why when I set the max size of the sprite to 64 and pixels to units to 64 it's still rendering 256x256?

  2. Second question is with the pixel to units, if I set it to 64 for my sprite, should all other sprites in the game share the 64 pixel to units ratio?

alt text

2.png (140.9 kB)
1.png (31.0 kB)
Comment
Add comment · Show 1
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 Loius · Jul 09, 2014 at 03:50 PM 0
Share

Perhaps the $$anonymous$$ax Size setting does not work well with sprites? Honestly I'm at a loss, I've never had issues with pixels-units setting. But I've also never changed the $$anonymous$$ax Size on an sprite source to something lower than the image's natural size.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by liszto · Jul 09, 2014 at 01:39 PM

To your first question, it's pretty weird. I didn't use the new 2D system a lot. But for me. I just take an example from on of my project.

I go a planet of 1024*1024.

I say this sprite will do 115px/unit

And my orthographic camera is set to 5unit (so 10 in the full height)

And my planet use 90% of the screen which is the size I expected.

To your second question I can say no. You can set the unit per pixel that you want.

BUT

if you do this you will lose the proportions between your assets. I think you design them to have a ratio and a logical proportions between them. SO if you wanna stay at the same scale for each of them you must put them all @ 64px per units. But if for some reasons you don't care so yeah you can put another pixel per units to another sprite.

Comment
Add comment · Show 3 · 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 AntLewis · Jul 09, 2014 at 02:14 PM 0
Share

Thanks for the response. As a test, I added a 960x640 sprite (to represent iPhone 4 resolution). I want to preserve the proportions as you suggest, so I set this to 64 pixels per units so it's consistent with my sprite. However when I do this, it's 50% smaller than it should be - setting it to 32 units per pixel makes it the right size (but it is obviously now not consistent with my sprites!) But it does make sense 20 world units high * 32 pixel per units = 640 pixels...

avatar image liszto · Jul 10, 2014 at 07:58 AM 0
Share

otherwise just set the orthographic size to 5 to divide per 2. And get a good match with your basis asset. Or simply define 1pixel = 1unit in your orthographic size that could avoid you a lot of mathematic reflections :)

avatar image phuclt093 · Nov 23, 2014 at 05:51 AM 0
Share

^^ Thanks

avatar image
0

Answer by developer_arni · Jan 09, 2016 at 02:48 PM

In regards to the initial question:

The documentation specifies the following

Max Texture Size: The maximum imported texture size. Artists often prefer to work with huge textures - scale the texture down to a suitable size with this.

I believe that the documentation is rather vague. However I believe that what you are expecting is the intended behaviour.

The Max Texture Size property should be considered a tool for you as a game designer to be able to turn down the quality of the imported image without altering with the conceptual size of the image in the editor, whereof conceptual refers to the original size of the image. This allows for the artists to work with high resolution images outside of Unity, whereafter you can choose between different levels of quality for the image inside of Unity.

This behaviour allows for the option to change the property at runtime or between builds, without you having to change anything in the objects using these images. In other words you can export different builds with different levels of quality or even have an in-game option for the user to switch between different levels of texture quality.

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

24 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

Related Questions

Failed loading fbx Importer 3 Answers

FBX importer at runtime(iOS) 0 Answers

AudioClip generated by an external process and loaded into the editor has no samples 1 Answer

Stairs in 2D 1 Answer

Orthographic camera "cutting off" part of the frame 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