GoogleFeud Posted December 26, 2021 Share Posted December 26, 2021 Hello everybody! I'm making a little game using pixi.js, and I want to use the `OldFilmFilter`. This is how I use it: const img = Sprite.from("..."); img.filters = [new OldFilmFilter()]; but, for some reason the filter doesn't work like it's supposed to. As you can see in the demo (https://filters.pixijs.download/v3.2.0/demo/index.html) the noise is animated, and there's other stuff going on. However, my image only comes out gray - there's no animation to it, it's just gray. I'm using Pixi v6.2.1, and pixi-filters v4.1.5 Quote Link to comment Share on other sites More sharing options...
GoogleFeud Posted December 26, 2021 Author Share Posted December 26, 2021 I figured it out... mods you can not approve this post. The demo is pretty misleading. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 27, 2021 Share Posted December 27, 2021 approved because otherwise you wont be able to make another post without review Quote Link to comment Share on other sites More sharing options...
Chillant Posted May 30, 2023 Share Posted May 30, 2023 If anyone happens to have this exact same issue here in 2023, like me, the solution is to randomize the seed of the filter every tick (or in whatever interval), like so: import {Application} from 'pixi.js'; import {OldFilmFilter} from 'pixi-filters'; const app = new Application(/* your stuff */); app.stage.addChild(/* your stuff */); app.stage.filters = [new OldFilmFilter()]; app.ticker.add(() => { app.stage.filters[0].seed = Math.random(); // <-- this line is needed }); I had to pick apart the code in the filter demos to figure this out... mariogarranz and Jhon 2 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.