PixelSpriteGenerator-Unity icon indicating copy to clipboard operation
PixelSpriteGenerator-Unity copied to clipboard

White Line on left edge of sprites

Open hoenn opened this issue 9 years ago • 3 comments

It's visible in your screenshots. Very visible in my attempt to make use of these scripts. Think it has to do with Texture Wrapping but I'm new to Unity.

hoenn avatar Jun 01 '16 02:06 hoenn

Hi @Hoenn

I know what you mean, and I'm sure I overcame this somehow when I used PSG in one of my personal projects, but looking through the code I didn't seem to make any changes. I did use a template mask with a bit of extra space on the sides though. Here is a script you can attach to a GameObject with a SpriteRenderer attached - just make sure you add the Default-Sprite material too.

https://gist.github.com/Shogan/674f2d6e9f86902b04a4a005bfe24f71

If I use that I don't get any white lines, so try that out and see if you can do the same for your mask?

I've tried messing with the texture wrap modes - clamp/repeat but that had no bearing on the white line effect. Point mode filtering is best too - bilinear or trilinear just blur the pixel effect on the sprites...

Shogan avatar Jun 01 '16 21:06 Shogan

Adding the '-0.02f' temporarily fixed my issue if (mask.mirrorX) { width = (mask.width * 2) -0.02f; }

Any idea why your output varies in color much more compared to the original? (Pretty noticeable on the many color variation outputs)

hoenn avatar Jun 03 '16 18:06 hoenn

I also noticed the color variation - no idea at the moment, I haven't really had the opportunity to see why. It seems like the Color struct matches the original version's color property, and is pretty straightforward with r,g,b,a values, so I'm not sure where the variation is coming in from.

Shogan avatar Jun 06 '16 08:06 Shogan