MrChampion Posted May 22, 2014 Share Posted May 22, 2014 Hello! I seem to be having a problem with TilingSprite texture wrap mode to repeat when using render textures to generate a new texture. When using a source texture with the correct size it works as expected: var _sprite = new PIXI.Sprite.fromImage("symbol_0.png"); var _tsprite = new PIXI.TilingSprite(_sprite.texture, 128, 128); setInterval( function() { _tsprite.tilePosition.y += 0.1; }, 10);If I try to render to a texture (to later use multiple sources dynamically batched together and to make a wrapping texture strip), the texture wrap mode seems to be using transforms with the original static frames and base texture despite the render texture size being smaller, instead of sliding the UVs in the texture. var _sprite = new PIXI.Sprite.fromImage("symbol_0.png"); var _sprite2 = new PIXI.Sprite.fromImage("symbol_1.png"); var _ct = new PIXI.DisplayObjectContainer(); _ct.addChild(_sprite); _sprite2.position.y += 128; _ct.addChild(_sprite2); var _rtexture = new PIXI.RenderTexture(128, 256); _rtexture.render(_ct); var _tsprite = new PIXI.TilingSprite(_rtexture, 128, 128); setInterval( function() { _tsprite.tilePosition.y += 0.1; }, 10);Tried trimming but it didn't work:"_rtexture.trim = new PIXI.Rectangle(0, 0, 128, 256);" Any idea to achieve the same effect? Something to copy the actual image pixel buffer to a new WebGLTexture with gl wrap mode in repeat? Quote Link to comment Share on other sites More sharing options...
MrChampion Posted May 22, 2014 Author Share Posted May 22, 2014 Forgot to add, I've tried some different aproaches with the variations of the same code, one of which was with the new 1.5.2 generate texture and it's the same behaviour as the second example, like this: var _sprite = new PIXI.Sprite.fromImage("symbol_0.png"); var _sprite2 = new PIXI.Sprite.fromImage("symbol_1.png"); var _ct = new PIXI.DisplayObjectContainer(); _ct.addChild(_sprite); _sprite2.position.y += 128; _ct.addChild(_sprite2); var _texture = _ct.generateTexture(); var _tsprite = new PIXI.TilingSprite(_texture, 128, 128); setInterval( function() { _tsprite.tilePosition.y += 0.1; }, 10);And still can't reproduce gl.WRAP, GL_REPEAT like with a POT single image texture source. 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.