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
4
Question by JudyNails · Jul 15, 2010 at 08:08 PM · iphonedisablemappingoptimisationmip

How do I turn off "mip mapping"

Hi guys and gals,

I'm devleoping a simple 2D game for children and becuase I'm such a novice I'm using as much middleware as possible! In this case, both Sprite Manager 2 and iTween. They're very cool and there's no way I could have gotten as far as I have without them.

Now, I read somewhere that for optimisation reasons (I'm devloping for iPhone), I should turn off mip mapping. Since I have absolutely no idea what mip mapping is, I don't know where to look. I've got some sprites created in SM2 with sprite atlases generated from the PNG images I've imported.

Are there any other optimising steps I should consider taking? I understand that using SM2 is a good start since it allows you to put lots of images onto one texture/ atlas, whatever...!

As always, thanks to anybody who can help!

Judy x

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
23
Best Answer

Answer by Noise crime · Jul 15, 2010 at 08:45 PM

Mipmapping can be found in the texture inspector. So go through all your textures one by one, select one in the project view and make sure you can see it in the inspector. Locate the 'Generate Mip Maps' option and disable it, then click on the 'apply' button.

You may also want to change the 'Filter Mode' to bilinear or point.

However 'Point' filtering often leads to something called 'Sparkles' when you move the camera view point. This is because 'point' sampling only maps the closest pixel from the texture to a single pixel in the rendered scene for that frame.

Now at 1:1 resolution this doesn't matter, but if the area the texture is being rendered to is smaller than the texture size then there could be several texture pixels that should cover a single pixel in the scene. Normally in these cases you'd take an average of all those pixels, but since we're just using the closest one, it often means that from frame to frame that a different one of those pixels will be chosen. Thus giving a sparkle effect as different pixels are shown on different frames.

The solution to this problem, which is highly effective is mip maps (which also greatly improve performance due to cache coherency). When using mip maps Unity generates a series of textures that are half the size of the previous texture. Effectively then this is downsampling and averaging. So if you have a 256x256 texture, mip maps will be generated for 128x128, 64x64, 32x32, 16x16,8x8,4x4 etc. The gpu can then use these as a quick look up to find the averaged pixel value. Obviously there is a 30% overhead in memory here as those mip-map textures need to be stored along with the original texture, hence the suggestion to disable them.

Since we have disabled them that route is no longer open to us. Luckily you can also specify that instead of the closest pixel you can do linear interpolation between the closest pixels, but this obviously requires more computation per pixel.

However i'm not yet familiar enough with Unity to know how you'd set that up. I can only assume (from testing) that keeping the filter mode set to 'bilinear' when you don't have mip-maps, will fallback to linear interpolation. So you'd probably want to use that.

Best advice is to turn off mip-maps and then run the program and test the different 'filter modes' of a texture and see which you prefer.

However be careful as whilst disabling mip-maps can save memory, it may end up taking more processing time. The reason being that mip-maps can often be more cache freindly, meaning the next pixel to be rendered is already in the gpu cache and will be faster to retrieve. For a full size texture being rendered far away, this is no longer the cases, thus more memory ends up being moved around to render the texture.

The only way to know for sure, is to test in your game. It may be you end up using a mixture of textures with and without mip-maps or you may find no decernable performance hit from not having them and using 'bilinear'

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 JudyNails · Jul 18, 2010 at 10:10 AM 0
Share

Thank you very much for such a comprehensive answer. I really appreciate your time!

avatar image Noise crime · Jul 18, 2010 at 11:39 AM 0
Share

No problem I hope it helps. Haven't used S$$anonymous$$2 (and can't find a demo) so not sure if there are any specifics in terms of textures it creates, if it does, but the general outline above will still hold true.

avatar image cregox · Apr 16, 2013 at 10:39 PM 0
Share

Additionally @JudyNails, toy with `Aniso Level` for better / more expensive results on angles. Worked for me.

avatar image arunkarnann · Nov 08, 2015 at 12:18 PM 0
Share

I am clear with mit map purposes now,Thank you so much @Noisecrime .

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

2 People are following this question.

avatar image avatar image

Related Questions

disabling bones and meshes when not in frustrum 1 Answer

Disable iPhone keyboard 1 Answer

Mesh building changes in Unity 3.5.6 0 Answers

What is Mip Maps (Pictures) 2 Answers

Disabling all Cameras Android/Iphone 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