Jump to content

RenderTexture works in Chrome but not in Firefox


lunarovich
 Share

Recommended Posts

Hello, I am building a game engine using Pixijs & SATjs and Tiled to construct maps. For optimization reason, I am rendering layers (DisplayObjectContainers) that contain tilemap sprites on RenderTextures with a following code:

bakeLayer: function(layer) {        var renderTexture = new PIXI.RenderTexture(this.width, this.height);        var sprite = new PIXI.Sprite(renderTexture);        renderTexture.render(layer);        sprite.alpha = layer.alpha;        sprite.level = layer.level;        sprite.position.x = layer.position.x;        sprite.position.y = layer.position.y;        sprite.parallax = layer.parallax;        sprite.name = layer.name;        sprite.tilemap = layer.tilemap;        sprite.collisionResponse = layer.collisionResponse;        sprite.baked = true;        return sprite;},

Now, in Chrome & Opera everything works fine:

 

JdPQvB4.png

 

However, in the Firefox I am getting the following result:

 

szLGsHy.png

 

Now, in PIXI documentation I've read that "All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead." However, if that was the case, neither Chrome nor Opera should have rendered it correctly. For the record, if I turn off the baking option, everything works fine in the Firefox as well.

 

A blue pipe is also baked and is on the top of the level display object container. Curious thing is that it's the only layer that is baked (rendered on rendertexture) that gets displayed correctly...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...