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 bradhouse · Sep 26, 2010 at 02:04 AM · spritespritemanagerspritemanager2

SpriteManager 2 pixel perfect blurry and stretched

I'm just starting to use SM2 v1.75 and I'm currently testing pixel perfect sprites.

I have 3 40x40 sprites and want to apply them to 3 GameObjects (cubes).

The camera is set up in Orthographic mode. I've unchecked Generate Mip Maps on the three original sprites.

The result is as follows: unity editor sprite issue

If you need more detail than the inline image, you can access the full size here: http://dl.dropbox.com/u/3655087/sm2-sprite-issue.png

The atlas in use is on the right of this image. The game window on the left shows the sprites are stretched vertically (2x the original height). SM2 appears to be auto-detecting the height incorrectly and setting Y to 2 in the PackedSprite.

If I do not use pixel-perfect and set the height to 1 then I get the correct size.

In both cases the sprites are very low quality relative to the original.

It's probably something really simple that I'm missing. Can anybody suggest what might be wrong for both the height and the quality of the sprites?

UPDATE #1:

Thanks to Brady's response below I've realised the mistake of not having a power of 2 texture in place (It was an iPhone target at the time of writing).

This solved the stretched textures, however I cannot get the Atlas generation to behave as I expect.

  1. If you assign a 40x40 image to a PackedSprite and it is the only PackedSprite in the atlas the edges of the image are blurry. This is the same as edges of the "Pixel perfect sprites" in the attached image.

  2. If you assign a 32x32 image to a PackedSprite and it is the only PackedSprite in the atlas, the edges are fine and the sprite renders as I'd expect.

  3. If you have more than one PackedSprite included in an atlas the edges are blurry as per #1. i.e. an otherwise working pixel perfect sprite is degraded once a second image is added to the atlas. For completeness the second image added was a 64x64 gradient png.

I've also witnessed the atlas generation duplicating the sprites included in a texture. Not to the extent it increased the size of the texture but filling unused space. The general problem is atlas generation is not consistent between executions for the same set of included PackedSprites/assets.

Cheers.

Comment
Add comment · Show 3
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 · Sep 26, 2010 at 03:09 AM 0
Share

I haven't used Sprite$$anonymous$$anager, but there's another question on UA that sounds similar: http://answers.unity3d.com/questions/7018/the-pixels-appear-quite-blurry-in-sprite-manager-2 $$anonymous$$ight help..?

avatar image bradhouse · Sep 26, 2010 at 03:27 AM 0
Share

I did see that one. This isn't a resolution problem. I'm expecting the same level of quality as is shown in the Atlas1.png image on the right. The game view on the left stretches and also blurs around the edges.

avatar image bradhouse · Oct 01, 2010 at 07:21 AM 0
Share

Given Update #1, I'll update the question with additional images in 24-48 hours.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Brady · Sep 26, 2010 at 07:39 PM

The issue of the "washed out" appearance of the sprites is due to the fact that the "Main Color" setting of your atlas material is set to full-white. By default, it is set to gray (50% white), which, because of the way the blended shader works, results in the sprite having the coloring of the original graphic when the sprite's own color is set to full-white. This is the default and unless you desire to have a sprite of full-white color appear highlighted (which can be very useful), it should be left at this value. In other words, under most circumstances, the "Main Color" of the material should be left at gray, and the individual sprite colors are what should be adjusted.

The issue of the sizing of the sprites is due to the fact that it appears Unity 3 has marked your atlas texture to be compressed. And since you are likely using an iPhone build target, this means the texture must be square (since PVRTC compression requires a square texture). Therefore, Unity is resizing the atlas texture so that it is 2x taller than it should be so that it can be square. If you require PVRTC compression, use the "Force Square" option when building your atlas instead. This will preserve the original aspect ratio of your graphics, while generating a square texture that can be compressed by PVRTC. Otherwise, select "Truecolor" in the import settings for the atlas to keep Unity from resizing the texture.

Comment
Add comment · Show 1 · 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 bradhouse · Oct 01, 2010 at 07:11 AM 0
Share

I'm surprised that I missed the power of 2 texture. It's pretty obvious. There are additional related problems that I'm yet to resolve. I'll update the question shortly.

avatar image
0

Answer by Brady · Jun 24, 2011 at 06:41 PM

To answer your updated issues, I think your blurriness could be a result of bad texture import/filtering settings (see the "Texture Sharpness" paragraph on the first page of the SM2 docs). Make sure your atlas itself is set to be uncompressed for the same reasons mentioned above.

On duplication of a sprite in the atlas, I don't see how that would be possible. Are you sure you didn't have two identical assets that were getting included? Out of the thousands of SM2 users out there, I've never before heard of duplicate inclusion on the atlas.

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

1 Person is following this question.

avatar image

Related Questions

iOS SpriteManager 2 issue with backgrounds 1 Answer

How do I use the PlayAnim function in SpriteManager 2? 1 Answer

Changing sprite properties at runtime 2 Answers

error CS1520: Class, struct, with Sprites 3 Answers

The name 'PackedSprite' does not denote a valid type ('not found') 3 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