PrettyMuchBryce Posted February 23, 2015 Share Posted February 23, 2015 I'm using pixi 2.2.5, and recently tried my project out on a retina ipad. I'm running into a strange texture resizing issue. This is probably my fault somehow, but I am struggling to figure out how to get the ipad to resize the texture properly. As you see in the attached image, it seems mobile safari is off by 1 pixel when trying to render each tile sprite. This makes it look like theres some space between each tile because it is actually partially rendering the bottom of the tile above this one in the texture. The tile sprites themselves live in a SpriteBatch, and I'm doing some resizing by setting the scale on this SpriteBatch itself. I'm not doing anything else special to try to support this device other than a viewport meta tag. I figure this may be related to the device pixel ratio. I tried to double the size of the tile spritesheet, but the issue still seems to occur. Quote Link to comment Share on other sites More sharing options...
msha Posted February 23, 2015 Share Posted February 23, 2015 Does it happen only in canvas renderer? Then it must be this bug - https://github.com/GoodBoyDigital/pixi.js/issues/1295 Quote Link to comment Share on other sites More sharing options...
PrettyMuchBryce Posted February 24, 2015 Author Share Posted February 24, 2015 Sorry for not clarifying. This is for the WebGLRenderer. CanvasRenderer doesn't seem to have the problem. Tonight I also tried not setting the scale on the SpriteBatch, but the problem still occurs. Quote Link to comment Share on other sites More sharing options...
msha Posted February 24, 2015 Share Posted February 24, 2015 Does this occur with both linear and nearest scaling modes? Quote Link to comment Share on other sites More sharing options...
PrettyMuchBryce Posted February 25, 2015 Author Share Posted February 25, 2015 Yep. It seems to happen on both LINEAR, and NEAREST scaleModes. Maybe I should open an issue on github, and try to see if I can recreate the issue in an isolated example. Quote Link to comment Share on other sites More sharing options...
digibo Posted February 25, 2015 Share Posted February 25, 2015 I had an issue that may be related. Actually two issues. Some of the sprite animations (MovieClips) were "shaking" on iOS, as if some of the frames were off by one pixel. By sheer luck I noticed in the Pixi code that renderSession.roundPixels was always false, so I added an option to both renderers to set it to true. This helped for some iOS devices, but not all. Next thing I did was to change my atlas images size to be a power of 2, which helped with the rest of the devices. You can try these, maybe it will help, as both seem related to scaling/pixel rounding. Quote Link to comment Share on other sites More sharing options...
PrettyMuchBryce Posted February 28, 2015 Author Share Posted February 28, 2015 Thanks digibo. Making the texture POT, and setting roundPixels to true seems to have resolved the issue. Appreciate the help. 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.