Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Sprites from buffer seem weird when use under blendMode

$
0
0

I had made a codePen demo to show this case(and 2 screen-capture-images below)

https://codepen.io/tomleader/pen/jOmNWJG

There are 3 buttons(click to see the result)

1. use img: The most common way , sprite.from(imgUrl), everything is ok!

2. use buffer: a little tricky.. the process is [new a Image obj and set src=url, draw Image to another canvas, getImageData from canvas, make a texture from imgData buffer, sprite.from(texture)], and the result seems weird!

3. use dataUrl: the process is [new a Image obj and set src=url, draw Image to another canvas, canvas.toDataURL, make a texture from dataURL, sprite.from(texture)], and the result seems ok!

So I think maybe the fromBuffer(imgdata) lost some pixels opacity data? OR I have some mistakes in my code? Any suggestions? Thanks ..

 

image.thumb.png.6e75838b432f88fbb562faf506083636.pngimage.thumb.png.098260d115f3c11fd9fddadc9e2d2bef.png


Viewing all articles
Browse latest Browse all 3978

Trending Articles