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.

Large WebGL context dimensions do not match drawingBufferWidth and drawingBufferHeight

See original GitHub issue

I can not say that this is really a bug but width and height of very large WebGL renderer do not match gl.drawingBufferWidth and gl.drawingBufferHeight (depending on hardware and browser). For example: In chrome 59 with

var test = new PIXI.WebGLRenderer({width: 4000, height: 2000, resolution: 1.5});

We have:

test.width = test.view.width = 6000
//and
test.height = test.view.height = 3000

but:

test.gl.drawingBufferWidth = 5792
//and
test.gl.drawingBufferHeight = 2896

A possible fix for this could be to automatically lower resolution so that width (resp. height) matches drawingBufferWidth (resp. drawingBufferHeight): in the previous example, setting resolution to 1.5 * 5792 / 6000 = 1.448 leads to:

test.width = test.view.width = test.gl.drawingBufferWidth = 5792
//and
test.height = test.view.height = test.gl.drawingBufferHeight = 2896

What is your feeling on this? Should this be done on application side or on Pixi side?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
manubbcommented, Jul 10, 2017

FYI, in order to dynamically change resolution of a renderer, i need to set new resolution both on the renderer and on renderer.rootRenderTarget. Then a call on renderer.resize(width, height) does the job. (It appears that updating resolution on the renderer only is not sufficient.)

0reactions
lock[bot]commented, Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Large WebGL context dimensions do not match ... - GitHub
There's workaround: A possible fix for this could be to automatically lower resolution so that width (resp. height) matches drawingBufferWidth ( ...
Read more >
WebGL Drawing Buffer size does not equal Canvas size
The WebGL spec allows for the drawingBuffer to be smaller than requested. This is precisely why drawingBufferWidth and drawingBufferHeight ...
Read more >
WebGL Resizing the Canvas.
Here's what you need to know to change the size of the canvas. Every canvas has 2 sizes. The size of its drawingbuffer....
Read more >
WebGLRenderingContext.drawingBufferWidth - Web APIs
The read-only WebGLRenderingContext.drawingBufferWidth property represents the actual width of the current drawing buffer. It should match ...
Read more >
html5.h — Emscripten 3.1.26-git (dev) documentation
WebGL context events. ... Maximum size 32 char (i.e. EM_UTF8 key[32] ). ... runtime should resize the canvas render target size to match...
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