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
1
Question by Romano · Feb 21, 2014 at 08:40 PM · 2dpixel art

2D: Is there a way to zoom without changing orthographic size or scale?

I feel like the answer to this might be no...

In my 2D game I have a pixel art background sprite that relies on the orthographic camera size sticking to one resolution to maintain its square pixels. Is there a way I can smoothly zoom the camera in without changing this orthographic size? I've thought about scaling everything in the scene up, but that would be a pain in the neck to deal with in my game.

Thanks very much!

Romano

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 Maui-M · Feb 21, 2014 at 10:22 PM 0
Share

Not that I know of, would be interested to know though.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Owen-Reynolds · Feb 21, 2014 at 11:38 PM

Can't be done. Whatever method was used to zoom, it has to cause the same "non-square" problem.

Say your image looks good at 128 pixels and zoomed in at 256 pixels, but not in between. This is what a "pixel correct" ortho camera size helps you do -- makes it easy to say that a cube takes exactly 128 or 256 screen pixels, and avoid those bad sizes. And that's all it does. If you zoom in, from 128 to 256 over time, no matter what technique, you're purposely making the image be all those sizes where it looks bad.

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 Romano · Feb 22, 2014 at 02:07 AM 0
Share

Thanks Owen. I'm not great at maths, you could be right that it's impossible to zoom between those numbers but I don't believe it can't be done at all with any resolution, since it does happen in games. I know that you can't simply decrease the orthographic size arbitrarily over time, but I wondered if there was another method that doesn't mean having to find each usable orthographic size.

I took a look at sword and sworcery on the iPad 3 with its retinal display. That zooms in very smoothly and with very sharp pixels. I tried it out on PC for comparison and with a resolution of 1366x768 the zoom still looked very good. Down at 640x480 I could tell there was a slight bit of wobbly pixel going on as it zoomed and it certainly wasn't as smooth. Is it just a case of finding all the usable orthographic sizes between $$anonymous$$imum and maximum and jumping between them? That could be tedious...

avatar image Owen-Reynolds · Feb 22, 2014 at 09:23 PM 1
Share

"usable [...] sizes between $$anonymous$$imum and maximum"

Exactly. And really, a sequence that looks good. $$anonymous$$aybe some sizes shrink his hat by a pixel, and some grow it by one. Choose either, just not both types alternating. It may be an equation -- like adding 8 pixels each time -- or trial and error.

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

20 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

Related Questions

Applying damage on enemy with OnParticleCollision (2D) 0 Answers

Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement 1 Answer

Should I change the Pixel To Unit ratio in a 2D Project? 0 Answers

How to make a 2d pixel art shader for a glass window that show outer space? 0 Answers

[SOLVED]Why my tilemap looks bad after I put it in Unity? 1 Answer


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