google-code-export / nekonme

Automatically exported from code.google.com/p/nekonme
1 stars 0 forks source link

TileSheet.drawTiles alpha transparency bug #176

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use TileSheet with PNGs with alpha transparency
2. best seen with light colors in PNG on light background

What is the expected output? What do you see instead?
Rendering obviously shows alpha-premultiplied colors (ie. darker) for the 
pixels with alpha transparency.

What version of the product are you using? On what operating system?
NME SVN

Please provide any additional information below.

Original issue reported on code.google.com by philippe...@gmail.com on 16 Jan 2012 at 10:06

GoogleCodeExporter commented 9 years ago
Hi,
Was this on iOS or other targets?  iOS has done some odd stuff with 
pre-multiplying in the past.
Hugh

Original comment by gameh...@gmail.com on 17 Jan 2012 at 12:22

GoogleCodeExporter commented 9 years ago
It happens in all targets for me.

Original comment by philippe...@gmail.com on 17 Jan 2012 at 1:03

GoogleCodeExporter commented 9 years ago
Hi,
I have had a look and I can't really see the effect.  Using the tiles directly:

class Test
{
   public static function main()
   {
      var sprite = new nme.display.Sprite();
      nme.Lib.current.addChild(sprite);
      var gfx = sprite.graphics;
      gfx.beginFill(0x20f0f0a0,0.25);
      gfx.drawRect(10,10,200,50);

      var bmp = new nme.display.BitmapData(64,128,true,
          #if neko { rgb:0xf0f0a0, a:0x40 } #else 0x20f0f0a0 #end );

     var tilesheet = new nme.display.Tilesheet(bmp);
     tilesheet.addTileRect( new nme.geom.Rectangle(0,0,64,128) );

     gfx.drawTiles(tilesheet,[0.0,0.0,0.0],true,0);

   }
}

The levels look correct, so I suspect the PNG.  I tried the gm2d particle 
sample with a light background and reduced alpha on the png, but could really 
say - but it seemed ok.  Perhaps a sample?

Original comment by gameh...@gmail.com on 31 Jan 2012 at 11:37

GoogleCodeExporter commented 9 years ago
You're right apparently, it seems to be an artifact due to tiles'
scale - blurring the edges make them look ok when reduced.

Well it looks right in cpp/win but I can't compile NME svn for Android atm.

Original comment by philippe...@gmail.com on 31 Jan 2012 at 5:03