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 Bregnar · Sep 05, 2012 at 05:21 PM · tileslines

Lines between tiles (tk2d)

Hey,

I create a 2D iPhone game and use image-tiles (160x160px, anchored at the bottom left corner) to fill my screen. The tiles are at a fix position. The first tile is for example at x:0 y:0 and ends at x: 160 y:160, the second starts at 160 / 160 and ends at 320x320 and so on... I move my cam over these tiles and it looks pretty perfect - only at the monitor.. Well.. when I test my App on an iPhone (4, 4s) or an iPad (1, 2), i see lines / borders between the tiles. I testet, if my cam has a float-position, but it hasn't...

Can anyone tell me why this happens (an looks fine on a pc?)?

PS: I use the tk2d spritemanager, I used EZ-GUI before, but in my opinion the performance is not very good...

Greetings, Bregner

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 flaviusxvii · Sep 05, 2012 at 05:26 PM 0
Share

Could be a product of aliasing or any number of things. Post some screen shots from both environments.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by ScroodgeM · Sep 05, 2012 at 06:46 PM

disable mipmapping for texture(s) used for tiles. to make 'em look good with mipmapping, you should understand a little what is it and make some extra borders on tiles

Mip Maps are a list of progressively smaller versions of an image, used to optimise performance on real-time 3D engines. Objects that are far away from the camera use the smaller texture versions. Using mip maps uses 33% more memory, but not using them can be a huge performance loss. You should always use mipmaps for in-game textures; the only exceptions are textures that will never be minified (e.g. GUI textures).

imagine that your atlas with tile has some 2x2 piece of pixels like this:

BB
BT

B is black pixel and T is tile pixel. in game only T pixel is used for tile model. but, when you tile is far enough, next mipmap level is activated. on next mipmap level your 2x2 pixels are blended into one with value of

0.75B+0.25T

and it is still used on your tile model. of course, it will look darker a little and on the tile border you'll see a black line.

to avoid this you need to disable mipmaps (not recommended if your tiles can be very far rom camera) or make some extra borders with tile's color

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
avatar image
1

Answer by Bregnar · Sep 06, 2012 at 10:00 AM

Problem solved. Well.. it was really simple .... My cam-pos had floats as position.. now I just use int and it works perfect... I was casting my floats to int before posting my problem - but I had a acceleration-method which used Mathf.Lerp and I havn't realized, that (most) floats are the result of this method (doh)... I just wrote a method which makes a nice acceleration without floats...

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
avatar image
1

Answer by christoffer.enedahl.hellothere · Nov 28, 2013 at 01:04 PM

Using Pad method: Extend for the tiled sprite solved it for me. You set it up in the SpriteCollection Editor, click on the tiled sprite and choose Extend in the Pad method dropdown. Click commit.

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 Imawizrd · Feb 16, 2014 at 11:57 PM 0
Share

Thanks! This worked for me.

avatar image
0

Answer by spencerj921 · Mar 03, 2014 at 10:53 PM

What fixed it for me is setting the compression for my 2D spritesheet to point instead of bi-linear

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

12 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

Related Questions

Background sprite tile movement jerks and flashes with black lines 0 Answers

How do I remove these transparent lines between my tiles? 1 Answer

Terrain Tile Seams and Terrain.SetNeighbor 1 Answer

Creating randomly disappearing floor tiles 0 Answers

Rolling Tilemap - Best way of doing it? 0 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