LaczkoUr Posted February 27, 2014 Share Posted February 27, 2014 I'm trying to use tilingsprite for the ground layer, and moving background layers in a 2d scroller game.There is a small but easily noticable visual bug at the edges of the textures.It seems like pixijs puts the second texture one pixel farther, than it should be. I scale all pixi.DisplayObject to fit the screen, in the current image the scale was between 1-2.I tried it out with scale=1, but the result was the same. I could work around this issue, by using 2 textures, and do a custom tilingsprite, but I think it would be nicer to use the pixijs one. It would be important for me to fix this issue. Quote Link to comment Share on other sites More sharing options...
mattdesl Posted February 27, 2014 Share Posted February 27, 2014 Are you using WebGL? Try making your grass texture power-of-two sized. Quote Link to comment Share on other sites More sharing options...
LaczkoUr Posted February 28, 2014 Author Share Posted February 28, 2014 I'm using webgl renderer.The Ground is 1024*128, so both sides are power of two. Quote Link to comment Share on other sites More sharing options...
xerver Posted February 28, 2014 Share Posted February 28, 2014 This often happens with non-integer scaling, and linear scaling in webgl. This is due to rounding errors since everything is a float. Try to use nearest scaling, and possibly lock to integer scales. Quote Link to comment Share on other sites More sharing options...
LaczkoUr Posted February 28, 2014 Author Share Posted February 28, 2014 I want to make my game scaleable to any resolution. The integer scale is not enough.I will try to the following.On resize, and gamestart eventcreate a new rendertexture with the necessery width-height. I put the original texture in a temp sprite scale it to the required value render the sprite on the rendertexture put the rendertexture in to the tilingsprite.Since the rendertexture's scale will be 1 the tilingsprite will render it correctly on the screen. This could be a garbage collectors wet dream, but : I will restrict to max 1 resize / sec, since every resize about 5 rendertexture have to be (one for each tilingsprite) created/dropped. Does this makes sense? Quote Link to comment Share on other sites More sharing options...
mattdesl Posted February 28, 2014 Share Posted February 28, 2014 This sounds like a bug to me. Using gl.REPEAT should not produce seams if you have a power of two texture. Also might want to double check and ensure the texture itself is seamless, and isn't the problem. And check the canvas renderer to see if the issue shows there as well. 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.