Author Topic: Tiled texture has black line gaps  (Read 7335 times)

steddyman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
Tiled texture has black line gaps
« on: November 05, 2012, 04:18:58 PM »
I created a 200 x 200 pixel texture in Photoshop using one of the patterns included (also 200x200).  I exported the file as a PNG and then I have imported it into NGUI and I am trying to use it for a tiled sprite background.  The pattern I am using is repeatable.

However, for some reason as soon as the vertical size goes above 200 pixels, I get a black line before the sprite is drawn again as can be seen the the attached photo.

I thought Tiled Sprites were supposed to just create a seamless texture?  There is no black lines in the PNG I created even when zoomed all the way in.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tiled texture has black line gaps
« Reply #1 on: November 06, 2012, 04:47:36 AM »
Well, first of all your original image is not tileable. You can see the edges easily. Taking a tileable photoshop texture and exporting a 200x200 slice of it doesn't guarantee that it's tileable. Try adding an offset filter to Photoshop of 100 by 100 pixels, and you will see what I mean.

Other than that, also select the sprite and give it a 1 pixel border. This will eliminate the lines on NGUI's side.

steddyman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
Re: Tiled texture has black line gaps
« Reply #2 on: November 06, 2012, 10:25:31 AM »
Hi

The 1 pixel border on the sprite in the atlas has fixed the black lines. 

Actually this is one of the in-built Photoshop patterns that is used for filing arbitary areas.  With the black lines removed, it is now tiling fine.

Many thanks.

bomberest

  • Guest
Re: Tiled texture has black line gaps
« Reply #3 on: July 05, 2013, 06:03:23 AM »
Atlas texture: texture type: Texure -> Atlas texture: texture type: GUI