question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not default to alpha = false when creating WebGL context

See original GitHub issue

I was trying to find a specific bottleneck in my PixiJS application and I found out that creating the context on my own made a HUGE difference (25-30 ➡️ 60 FPS on a 4K monitor). The difference was that I enabled alpha alpha: true when creating the WebGL context.

PixiJS defaults to alpha: false if the transparent option is not passed:

https://github.com/pixijs/pixi.js/blob/54665ecebe676bd0d89e7ceadabb1badd89c1cbb/packages/core/src/Renderer.ts#L280

Evidence of this being a performance bottleneck

Maybe we want to reevaluate whether transparent = false by default?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ShukantPalcommented, Sep 3, 2020

@bigtimebuddy Maybe a v6 milestone?

0reactions
ShukantPalcommented, Dec 11, 2020

Sure. I’ll do it over this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do not default to alpha = false when creating WebGL context
I was trying to find a specific bottleneck in my PixiJS application and I found out that creating the context on my own...
Read more >
WebGL and Alpha
The default is true. ... A really good way to find if you have any alpha problems is to set the canvas's background...
Read more >
How to fix crossbrowser issue with alpha blendmode in webgl ...
in clearCanvas you clear the alpha to one and then turn off rendering to alpha but because preserveDrawingBuffer is false (the default) the ......
Read more >
607130 - WebGL context with alpha=false performs ... - Monorail
Issue 607130: WebGL context with alpha=false performs worse than context with alpha=true on OS X. ... What is the expected behavior? Both pages ......
Read more >
WebGLRenderingContext.getContextAttributes() - Web APIs
The WebGLRenderingContext.getContextAttributes() method returns a WebGLContextAttributes object that contains the actual context parameters.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found