opengl es - Android. AndEngine. Image artifacts where transparency is used -
opengl es - Android. AndEngine. Image artifacts where transparency is used -
i using andengine (2d opengl-based engine). when utilize textures transparency (png images) have image artifacts on borders on image. need help fixing this. have attached 2 images. on first have text displayed using font. on sec can see rounded corner on corner of texture can see artifact well. please note occurs on real device. on emulator ok. device samsung i5700 galaxy spica running android 2.1
big community wiki of andengine artifacts sprite artifacts
bilinear filtering interpolates colour of nearest 4 pixels, makes texture nice while scaled/rotated, or shifted non-integer values, has difficulties.
black or dark line artifactthe texture atlas background perchance black, , border pixels of texregion mixed background. utilize custom transparent texture atlas, or utilize modified textureatlas builder fills transparency (todo find forum link described)
sprite border has unwanted alphaif texture background transparent, alpha still mixed border colors. add together 1-pixel extrusion texture part (repeat border pixels in row/col @ edges), , position part edges between original , added border pixels. create sure bilinear interpolation picks pixels region.
other border artifactif texture regions close, part border may take pixels other regions edge. utilize padding between texture regions.
text artifacts ocassional little vertical line under baseline (gles1)in font, j
char had overly left-extending lower curve, causes little artifact when rendering i
letter, since ij
next each other in texture, , perchance near.
try lowering font size, increasing texture size, or hacking in larger font.padding
value (5
worked me instead of 1
). note default, increasing padding
increases line spacing too, may not desired. new ypadding
can introduced , used necessary compensate.
the letters rendered font texture atlas on-demand. can lead running out of space on texture atlas, yielding fun effects (see dissapearing changeabletext).
one solution can insert snippet font#createletter(char)
method:
if (this.mcurrenttexturey + letterheight > textureheight) { throw new illegalstateexception("could not allocate space letter " + pcharacter + " on texture. " + "please enlarge texture atlas size. letter #" + this.mlettercount); }
android opengl-es andengine
Comments
Post a Comment