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 Happy-Zomby · Aug 01, 2020 at 08:14 AM · graphicsimagespriterenderer

Sprite resolution in function of camera zoom

Hello,

My game units are gameObjects with a sprite renderer attached. For each unit I have the same sprite but in 3 different compression levels (256, 64 and 32). Then I vary the used sprite in function of my camera zoom level. But is this the right approach?


If zoomed out to its maximum - the unit will be represented using the max 32 sprite, if zoomed in tight it will use the 256 compressed sprite (I will change this to 128 I believe). You can see some details in the attached: alt text But I'm still not very happy on how "clean" the sprites look and I'm also I'm not sure how this will turn out in various resolution and if it is the correct/best way to do this? Any thoughts or advice?

Thanks a lot,

sprite-compression.png (136.2 kB)
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
1
Best Answer

Answer by Namey5 · Aug 02, 2020 at 02:18 AM

Is there a reason you can't just use mipmapping? This is kinda the purpose it was created for.

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 Happy-Zomby · Aug 02, 2020 at 07:45 PM 0
Share

I will explore this and see if it works for my situation. Thanks!

avatar image Happy-Zomby · Aug 02, 2020 at 08:44 PM 0
Share

Hi, effectively mipmap seems to do the trick - not sure why I didn't find this out earlier when doing my research... shameful of me and thanks for your help. In the below, you can see the mip map version to the left and the change sprite compressed sprite version I was using to the right... very comparable - sometimes the mipmap seems a bit more fussy, sometime the compressed version to jagged... Do you have any thoughts on the performance of which? I call the check texture function I have only when the zoom is changed - not sure how this would compare to mipmap. Thanks a lot!!!

alt text

mipmap.png (184.8 kB)
avatar image Namey5 Happy-Zomby · Aug 02, 2020 at 09:23 PM 0
Share

$$anonymous$$ipmapping is done automatically in the shader (whether or not your texture has mipmaps enabled, it will probably be sampled as though it does because the hardware is built to always use mipmaps) and will always choose the best resolution for the size on screen. This means that you won't get aliasing from sampling a texture at a higher res that the screen (like is probably happening in your other example) and it's actually better for performance as you only sample as high a resolution as you need without needing to do additional work.

avatar image Happy-Zomby Namey5 · Aug 03, 2020 at 06:19 PM 0
Share

Great - I will shift to this method. Thanks a lot. If you want to add mipmaps as an answer I will be happy to validate it. Cheers,

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

149 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

Related Questions

Writing Reusable Components for both SpriteRenderer and UI.Image? 3 Answers

Converting multiple sprites in a single 0 Answers

Deferred lighting: How to improve quality and anti-aliasing? 4 Answers

Minecraft Models 0 Answers

How do I set a sprite to fill the entire screen in UI? 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