jered Posted July 30, 2015 Share Posted July 30, 2015 Hey all, I'm trying to figure something out with pixi.js filters. Namely, how do I effectively disable filters sometime after enabling them? I'm building a small HTML5 app targeting mobile devices. I'd like to use the BlurFilter in a few places for some nice visual effects. Since these effects are only needed temporarily, my plan is to add the filters when necessary and remove them when they're no longer needed. Unfortunately what I've noticed is that the performance hit from using filters lingers even after removing them from their objects. For example, my app is a solid 55-60 fps before applying any filters. After applying a BlurFilter to a single Graphics object, performance takes a small hit as expected down to ~47 fps. Then I remove the filter, expecting the performance to improve back to 55+ fps, but it doesn't. Even with the filter removed, performance never recovers to its pre-filter levels. I'm adding the filters like this: someGraphicsObject.filters = [new PIXI.filters.BlurFilter()]; And removing it like this: someGraphicsObject.filters = null; I've tested on Android and iOS using Crosswalk and Phonegap respectively, as well as native Chrome/Safari browser apps. Same story across all tests, so it must be something with the pixi.js library... Is there a better way to ensure disabled filters no longer impact performance? Thanks. Quote Link to comment Share on other sites More sharing options...
xerver Posted July 30, 2015 Share Posted July 30, 2015 Hmm, can you post this to GitHub and show a running example that reproduces the issue? Going to require some investigation. Quote Link to comment Share on other sites More sharing options...
jered Posted July 30, 2015 Author Share Posted July 30, 2015 I dug more into my own code and found an error there that seems to be the root of the problem. Chalk this one up to user error. Nothing to see here. 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.