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

Bug: Empty sprite can break graphics rendering when using WebGPU + Chrome in 8.0.0-rc.9 #10199

Closed
SuperSodaSea opened this issue Feb 8, 2024 · 2 comments
Assignees
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release. v8

Comments

@SuperSodaSea
Copy link
Member

Current Behavior

Adding an empty sprite can break graphics rendering when using WebGPU + Chrome in 8.0.0-rc.9, as shown in the code in Steps to Reproduce.
Note that the empty sprite does not always break the rendering, changing the content of the graphic may give a different result.

When using WebGPU:

Wrong

Expected Behavior

The result when using WebGPU should match the result with WebGL.

When using WebGL:

Correct

Steps to Reproduce

(async () => {

const app = new PIXI.Application();
await app.init({
    preference: 'webgpu', // 'webgl'
    hello: true,
    width: 300,
    height: 300,
    backgroundColor: 'black',
});
document.body.appendChild(app.canvas);

const createGraphics = () => {
    return new PIXI.Graphics()
        .circle(0, 0, 50)
        .fill('blue')
        .stroke({ width: 10, color: 'red', alignment: 0 });
}

const graphics1 = createGraphics();
graphics1.position.set(100, 100);
app.stage.addChild(graphics1);

app.stage.addChild(new PIXI.Sprite()); // <-- HERE!!!

const graphics2 = createGraphics();
graphics2.position.set(200, 200);
app.stage.addChild(graphics2);

})();

Environment

Possible Solution

No idea at the moment. To be honest, I'm not very familiar with the new rendering system in PixiJS v8...

Additional Information

The example code works just fine in Firefox 122 on my computer. Very strange...

@SuperSodaSea SuperSodaSea added 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. v8 labels Feb 8, 2024
@GoodBoyDigital
Copy link
Member

interesting!! looks like the texture for the empty sprite is being used for the second graphics! Will investigate

@SuperSodaSea
Copy link
Member Author

Fix confirmed in 8.0.0-rc.10. Thanks @GoodBoyDigital!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release. v8
Projects
None yet
Development

No branches or pull requests

2 participants