Problem texture applied on object for Samsung S3 4.1

Started by zerofox, July 25, 2013, 08:36:31 AM

Previous topic - Next topic

zerofox

Hi,

I got problem on my object when i apply the texture, in Samsung S3 it looks there are some background color with not exact pattern , the texture image have alpha color. I tested on other device Samsung Galaxy Ace 2.2 and Samsung S2 4.0,  there is no problem with  this background color in texture when applied to the object. I attached the screenshots, the first one the image that got background in S3, and the second one is the actual texture image. Please help

[attachment deleted by admin]

EgonOlsen

How are you loading the texture (code snippet...)?

zerofox

Hi Egon, here is the code. pretty simple code actually

texture = new Texture(bmpList.get(i),true);
texture.keepPixelData(false);
TextureManager.getInstance().addTexture("texture1", texture);

EgonOlsen


zerofox

bmpList is an arraylist of Bitmap. It's populate the bitmaps by getting the image through the server and convert it to bitmaps also  in the app i make it scale to 256x256 in case the dimension is not supported by the texture function, could this probably the caused? But how come in Ace 2.2 and S2 they have no problem with this issue. anyway maybe my scaling function have an effect to this? i show you the code :

public static Bitmap getScaledBitmapAndNoRotateBitmapPixel(Context ctx, Bitmap tempBmp, int width, int height){
      
 
        Bitmap resizedBitmap = Bitmap.createBitmap(Bitmap.createScaledBitmap(tempBmp, width,height, false), 0, 0,
               width, height,null, false);
       
        tempBmp.recycle();
        tempBmp=null;

    
     return resizedBitmap;
   }

Any idea what this caused? or maybe a hacks to fix this issue Thanks!

EgonOlsen

Your texture actually looks that way if you ignore the alpha channel. So i think that something in your pipeline removes the alpha under some circumstances. Maybe there's a Drawable involved somewhere? In that case, you might be a victim of Android's automatic rescale and maybe that kills the alpha!?

zerofox

solved!!?!?! have been banging my head for this issue, it turns out somehow the image in the server have a different alpha that its used. So i tried to edit the image and reapply the alpha on the image again, and it works no weird background issue. So something wrong when they applied the alpha on the image  :o