Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter doesn't work #313

Open
kareljuricka opened this issue Nov 27, 2021 · 3 comments
Open

Filter doesn't work #313

kareljuricka opened this issue Nov 27, 2021 · 3 comments

Comments

@kareljuricka
Copy link

I'm not sure, what I'm doing wrong but I can't get any custom filter to work. Build-in filters work correctly.

Link to reproduce:
https://stackblitz.com/edit/typescript-qu4egd?file=index.ts

No errors in console..

Thanks for any advice..

@kareljuricka kareljuricka changed the title Filters doesn't work Filter doesn't work Nov 27, 2021
@bigtimebuddy
Copy link
Member

Adding a Ticker fixes the problem or using Renderer's prepare plugin. Even though your image is downloaded (with onload), it needs to be uploaded to the GPU, which can take about frame or so.

Use Ticker

const ticker = new PIXI.Ticker();
ticker.add(() => renderer.render(container));

Use Prepare

renderer.plugins.prepare.upload(sprite, () => {
    renderer.render(container);
});

@kareljuricka
Copy link
Author

kareljuricka commented Nov 28, 2021

@bigtimebuddy thanks for tips

I don't like Ticker solution due to need to start a Ticker timer.
So I tried to make it work with prepare solution, but with no luck. I updated stackbliz, please look if you can help me with what I'm doing wrong. Callback is called but nothing is rendered..
https://stackblitz.com/edit/typescript-qu4egd?file=index.ts

@bigtimebuddy
Copy link
Member

Call render once before doing the upload. I this this maybe a bug, but I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants