DEV362 Posted December 8, 2015 Share Posted December 8, 2015 Hi, is here any performance advantage between sprite.visible = false and sprite.texture = PIXI.Texture.EMPTY ? tx Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 8, 2015 Share Posted December 8, 2015 sprrite.visible=false means that updateTransform() wont be called every frame, and matrix wont be updated. Quote Link to comment Share on other sites More sharing options...
DEV362 Posted December 8, 2015 Author Share Posted December 8, 2015 Ok.... and will be transform called when the texture is set as EMPTY? Shouldnt it be the same? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 8, 2015 Share Posted December 8, 2015 look at https://github.com/pixijs/pixi.js/blob/master/src/core/display/Container.js#L338 visible=false means that this container and all its childrens matrices wont be updated.renderable=false means that container will be updated but not rendered. Its optimal for culling.texture = TEXTURE.EMPTY is not the case, i dont see special cases about it at all: https://github.com/pixijs/pixi.js/blob/master/src/core/sprites/Sprite.js . Sprite will be rendered anyway, you will only save some time because sprite area will be small and fragment shader will be called only a few times. Quote Link to comment Share on other sites More sharing options...
xerver Posted December 9, 2015 Share Posted December 9, 2015 There are no special handlings for Texture.EMPTY, it is just an empty texture and the object will be updated and rendered normally; just using an empty texture. 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.