Author Topic: Overlapping two sprites of the same color without seeing edge?  (Read 7619 times)

Fordeka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Overlapping two sprites of the same color without seeing edge?
« on: October 31, 2012, 09:15:15 AM »
When I try to put one sprite on top of another I can see the edge of the top sprite even though it is the same color as the bottom sprite- is there any way to fix this? Thanks.

PieterInfinity

  • Guest
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #1 on: October 31, 2012, 10:21:58 AM »
Hey, I think you're looking for this, this is what we're using for some of our backgrounds.
The white background is a 6x6 texture, add 1 unit to the Left and Top dimension and subtract 2 from both Width & Height.
(See attached image)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #2 on: November 01, 2012, 08:33:26 AM »
The thing that sucks about doing it like that, is that next time you rebuild your atlas you have to manually do this again, since it will cut it off at the borders again, making it 4x4 with soft edges again.

PieterInfinity

  • Guest
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #3 on: November 01, 2012, 09:20:56 AM »
Yea that sucks indeed, do you have a better solution?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #4 on: November 01, 2012, 09:41:25 AM »
The sprite that goes into the atlas must be solidified. Search the forums for "solidify" and figure out how to use the Flaming Pear Solidify A filter in Photoshop.

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #5 on: November 01, 2012, 06:46:29 PM »
To me that looks like a shader blending issue. It looks like the horse head is rendering later and using an alpha test shader (thus the very rough edges) and it is not blending properly with the colors that was already there previously rendered. Are these sprites using the same panel to render? Is the panel that is rendering show the appropriate number of draw calls that you are expecting? Are you using a custom shader on this sprite atlas? Does this issue persist using one of the standard NGUI transparent colored shader?
« Last Edit: November 01, 2012, 06:48:07 PM by Ferazel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Overlapping two sprites of the same color without seeing edge?
« Reply #6 on: November 02, 2012, 02:43:13 AM »
To me it looks like the horse head shader writes to depth, and the blue square uses depth testing. You might want to use Unlit/Transparent Colored shader for all of them.