• Editor
  • Why is bleed an option?? (black lines around sprites)

  • Đã chỉnh sửa
Related Discussions
...

AND WHY IS IT ON BY DEFAULT???

It drove both the programmer and artist mad trying to figure out where the lines kept coming from on the joints of the sprites; I spent all day fighting with Anime Studio and editing each individual part of all of my characters with GIMP trying to get rid of them, and the programmer has spent weeks trying different alpha blending techniques and it's been driving us INSANE.

Then tonight we were discussing it and we decided to start fiddling around with Spine settings, and what do we find? Under Atlas settings, bleed is an option, and it's ticked by default. Turning that off got rid of the mystery lines. WHY BLEED??? D: D: D:

Sorry you had trouble with the texture packing. There are many packing options that are useful in various situations.

Bleeding prevents artifacts that occur when filtering (the selection of pixels when scaled) mixes colors from adjacent pixels. So you have a green pixel (RGBA 0,1,0,1) next to a transparent pixel that your image editing program has made red (1,0,0,0). When the image is scaled, filtering can pick up the red color from the transparent red pixel and you'll end up some red mixed in to your green. Bleeding extrudes the colors from non-transparent pixels into transparent pixels so filtering doesn't introduce unwanted colors. It looks like this:

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Here is a page with more pictures.

The problem described is only an issue when not using premultiplied alpha. When not using premultiplied alpha, blending is actually incorrect, even though it may often look close to correct. Premultiplied alpha is always preferred and this problem doesn't occur.

Bleeding is unlikely to cause black edges. More likely is that premultiplied alpha makes your images appear to have black edges when opened in an image viewer. This is actually correct and the black edges won't be visible when the images are rendered for premultiplied alpha in your game.

If your problem is that you can see edges of images when rendered at runtime, then you can fix this by using premultiplied alpha in the atlas and choosing the correct blending for premultiplied alpha at runtime (eg GL_ONE, GL_ONE_MINUS_SRC_ALPHA).

7 ngày sau

I see now >.< thanks for answering!