zarstar Posted August 13, 2014 Share Posted August 13, 2014 Hi guys,I have a problem with texture frames and scaling. Pratically I have a DisplayObjectContainer and a lot of Sprites in it.Each Sprite has a Texture, got by applying a crop from an original Texture.So each Sprite shows just a part of the original Texture.The original Texture background color is black. Now the problem is that when I scale the DisplayObjectContainer quickly, some bars appears (the bars are the black background of the original Texture).So pratically it's like PIXI doesn't mantain the frame of the Texture perfectly. I uploaded a video to let it be clearer (at the end there is a "slow motion" part):http://gabrielenosso.com/temp/pixiproblem.mp4 So what do you think can I do to solve the problem?And should I post it to the PIXI Github page? Quote Link to comment Share on other sites More sharing options...
Sebi Posted August 13, 2014 Share Posted August 13, 2014 Does this issue happen in both renderers or only the WebGL Renderer? Looks like an rounding issue which happens in the WebGL shader. Maybe you could try to extrude your tiles 1 px in each direction. Just an example: 0.1 * 0.2 is 0.020000000000000004 and not 0.02. Most fractions can't be represented with their exact value. And that is most likely why your texture is sometimes 1 px off. Quote Link to comment Share on other sites More sharing options...
zarstar Posted August 13, 2014 Author Share Posted August 13, 2014 Honestly I didn't tried it with the Canvas Render, however I need it to work with the WebGL Renderer. I'm aware about the problem about fractions binary representation, but what could I do about it? Removing a pixel isn't an option for me: i really need every single pixel of the image. Coulnd't PIXI round the textures frame with Math.floor() / Math.round() or something like that? 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.