filters icon indicating copy to clipboard operation
filters copied to clipboard

Bug: Unable to static render filter after prepare

Open kareljuricka opened this issue 4 years ago • 3 comments

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 avatar Nov 27 '21 11:11 kareljuricka

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);
});

bigtimebuddy avatar Nov 27 '21 23:11 bigtimebuddy

@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

kareljuricka avatar Nov 28 '21 01:11 kareljuricka

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

bigtimebuddy avatar Nov 28 '21 15:11 bigtimebuddy