• 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 ADB · Mar 01, 2012 at 09:31 PM · spritealign

How to properly align sprites to avoid lines?

I am pretty sure I have seen a similar question around, but I can't find it anymore. So anyway, I am trying to tile together a few images to create a backdrop for the game.

The background itself is 2500x1600, so I broke it down to 1024x1024 chunks where I can (or smaller for the leftover). I am using Sprite Manager to reduce the draw calls for the smaller chunks that can be combine in an atlas.

Using an orthographic camera of size 3 for a target height of 600 pixel, I then have 1 pixel = 0.01 unit. The larger chunk sizes are then 10.24 x 10.24. Everything makes sense, dimension wise, except I can see lines between the sprites:

alt text

I have made sure the PNG are imported with Point and no compression. The atlas building doesn't allow trimming or padding and are of size 1024. They aren't compressed either.

What am I missing?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Anxo · Mar 01, 2012 at 10:20 PM

Set you texture on import to "Clamp" instead of "repeat"

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 ADB · Mar 01, 2012 at 11:08 PM 1
Share

That and putting the Sprite Atlases filter modes to Point solved it. Thanks

avatar image m4a44 · Apr 19, 2013 at 03:03 AM 0
Share

Wow, that was a stupid necessity. Was driving me nuts because it happened every so often, yet on my latest build it was too noticeable... -_-

avatar image GFernandes · Dec 17, 2013 at 02:47 PM 0
Share

What if this happens using SpriteRenderer and sprites ins$$anonymous$$d of textures?

avatar image
0

Answer by Nub3h · Feb 12, 2013 at 11:19 AM

mmm...for me the Clamp + Point solution isn't working. I think I have some floating errors when two planes are alined at runtime. I'm also using SpriteManager 1.0 to create the two planes since it's a street.

Any idea?

At the moment I fixed the problem by having my tiles slightly offset on the Z axis and slightly stretched on the width so that they overlap a bit in order to not see the background color (which is ultimately what those lines are, there's a floating point error that creates those gaps).

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to Rotate 2D Sprite Towards Moving Direction? 0 Answers

How to get "pixel" color for Sprite (U4.3)? 2 Answers

Level alignment script crashing after a few iterations 2 Answers

Sprite Facing Responds Late 0 Answers

Custom Inspector. Aligning properties? 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