DEV362 Posted December 21, 2015 Share Posted December 21, 2015 Hi, can I use own renderer for each RenderTexture? I'm trying render a video into texture which i want to use on multiple sprites, but with WebGL renderer there are problems with rendering videotexture in some browsers. So I want to use WebGL renderer only for rendering main stage and CanvasRenderer for "prerender" videotexture in RenderTexture. Is it possible? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 21, 2015 Share Posted December 21, 2015 Not all browsers support this feature, i believe Quote Link to comment Share on other sites More sharing options...
xerver Posted December 21, 2015 Share Posted December 21, 2015 If you are using a canvas renderer for the precached texture, then you don't need a render texture at all. Just have a canvas renderer, draw to it, and then create a texture out of the canvas it is drawing to.You can then use that texture in your webgl scene. var renderer = new PIXI.WebGLRenderer(...);var canvasRenderer = new PIXI.CanvasRenderer(...);var cacheSprite = new PIXI.Sprite(PIXI.Texture.fromCanvas(canvasRenderer.view));canvasRenderer.render(precachedScene);renderer.render(cacheSprite); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 22, 2015 Share Posted December 22, 2015 Dont forget to update it (make texture.dirty = true) every time you change it to re-upload to GPU Quote Link to comment Share on other sites More sharing options...
xerver Posted December 22, 2015 Share Posted December 22, 2015 Dont forget to update it (make texture.dirty = true) every time you change it to re-upload to GPU You should use `texture.update()` so that PIXI will update it, setting dirty does nothing in v3. 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.