Skip to content

Extrude edges of a Texture instead of surrounding it with transparent padding #97

Closed
wants to merge 1 commit into from

3 participants

@nazgee
nazgee commented May 3, 2012

Padding texture region with transparent region in some cases results
in appearance of display artifacts. This patch changes transparent padding
into borders extruded from a bitmap texture region.

I believe, that this change will automagically fix most of: "there is a gap between two sprites when camera moves" complaints.

DISCLAIMER: This is not very thoroughly tested. I can only see that this commit fixed most (all?) of the glitches I've seen when moving/scaling two adjacent Sprites.

@nazgee nazgee Extrude edges of a Texture, instead of surrounding it with transparen…
…t padding

Padding texture region with transparent region in some cases results
in appearance of display artifacts. This patch changes transparent padding
into borders extruded from a bitmap texture region.
5f052a2
@larku
larku commented Jul 5, 2012

I've been using this patch to fix the dreaded gaps/lines glitches that can be seen around sprites in some situations - this has totally fixed it for me.

I understand there are other workarounds such as using texture packer to extrude sprites etc, but this fix is far more elegant and does not require any additional work by the developer.

What's more is this fix will also work for runtime rendered SVG images - this can't really be done using texture packer.

I add a vote for this to be merged into GLES2.

@Niffy
Niffy commented Sep 15, 2012

Sorry to be a pain but how do you use this? Looking at the code

@Niffy
Niffy commented Sep 28, 2012

Hellos. Coming back to this, as I've got a TMX map with lots of artifacts so would like to try this out.
So how do I go about using it, can't seem to fathom it out.

@nazgee
nazgee commented Sep 30, 2012

Here is a description:
http://www.andengine.org/forums/post38274.html?hilit=extrude#p38274

There are some crashes (that can be workarounded somehow) when this patch is used. I've never get the nerves to fix it properly, unfortunately...

@nazgee nazgee closed this Feb 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.