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

Using AdjustmentFilter in @pixi/webworker causes an error #486

Open
gubeils opened this issue Jan 22, 2025 · 1 comment
Open

Using AdjustmentFilter in @pixi/webworker causes an error #486

gubeils opened this issue Jan 22, 2025 · 1 comment

Comments

@gubeils
Copy link

gubeils commented Jan 22, 2025

I am using the following versions in my project:

"@pixi/webworker": "^7.4.2"
"pixi-filters": "^5.3.0"
When I try to use AdjustmentFilter within a Web Worker, it results in an error.

Here is the code snippet:

import * as PIXI from "@pixi/webworker";

const adjustmentFilter = new AdjustmentFilter({
  brightness: 1.2, 
  contrast: 1.5,   
  saturation: 1.3, 
  gamma: 1.0,      
  red: 1.1,       
  green: 1.0,      
  blue: 0.9,       
});
videoSprite.filters = [adjustmentFilter];

app.stage.addChild(videoSprite);

Error Message:
adapter.ts:36 Uncaught (in promise) ReferenceError: document is not defined

Image

It seems like the AdjustmentFilter is trying to access the document object, which is unavailable in the Web Worker context.

How can I make AdjustmentFilter work in the Web Worker environment? Are there any workarounds or specific configurations needed?

@gubeils
Copy link
Author

gubeils commented Jan 23, 2025

Image

Image

Image

Image

Image

Image

Image

Image

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

1 participant