rich Posted November 28, 2014 Share Posted November 28, 2014 Anyone seen this happen before: Samsung S3 - all the latest updates applied - stock browser (naturally it works fine in Chrome on the same device) What you're seeing is that the images that look absolutely fine, like the bee, shoes, eraser, etc are just normal PNGs being drawn to the canvas. The ones with "corruption" around the edge are being drawn from a hidden canvas object. The same applies to the mess in the middle. The "normal" looking parts were drawn with native canvas graphics operations like arc and drawRect. The little rainbows were just drawImage from a PNG source. The corrupted mess is a drawImage from a canvas object. Anyone have any ideas?! Quote Link to comment Share on other sites More sharing options...
AshleyScirra Posted November 28, 2014 Share Posted November 28, 2014 If you're after wild guesses, it looks like an alpha channel problem (since it's fringes around objects where the alpha is probably between 0 and 1, and I guess your pen-drawing code uses alpha to make a soft brush effect?). I'd suspect some kind of premultiplied alpha problem, or perhaps accidental use of a 1-bit alpha format. Maybe check the canvas creation attributes. I don't know what will be supported but it might be worth turning on/off alpha, antialias, or trying to look up any non-standard ones Samsung might have added. Quote Link to comment Share on other sites More sharing options...
rich Posted November 28, 2014 Author Share Posted November 28, 2014 Now you mention it it does indeed only happen where alpha isn't 0 or 1, and yes the brush textures use alpha heavily for effects. I've checked and the source PNGs (which are tinted to create the coloured versions) are not 8-bit, so time to investigate canvas settings. Quote Link to comment Share on other sites More sharing options...
rich Posted November 28, 2014 Author Share Posted November 28, 2014 Sadly none of them work. I've tried all kinds of attributes (alpha, willReadFrequently) even WebGL ones like depth but with no joy. Damn you stock browser! Quote Link to comment Share on other sites More sharing options...
AshleyScirra Posted November 29, 2014 Share Posted November 29, 2014 Does the browser support WebGL? Could you swap it out for a WebGL renderer instead? Quote Link to comment Share on other sites More sharing options...
mfdesigner Posted December 11, 2014 Share Posted December 11, 2014 Could be a mismatch of pixel format, RGB vs. RGBA. Quote Link to comment Share on other sites More sharing options...
rich Posted December 11, 2014 Author Share Posted December 11, 2014 Sorry I forgot to update this post - the issue was a wonderful stock browser one where the alpha channel gets bit shifted if written back without modification. Thankfully now fixed and patched in the Phaser version of Pixi (where it manifests in the CanvasTinter class) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.