Large WebGL context dimensions do not match drawingBufferWidth and drawingBufferHeight
See original GitHub issueI 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:
- Created 6 years ago
- Reactions:1
- Comments:16 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, in order to dynamically change resolution of a renderer, i need to set new resolution both on the
renderer
and onrenderer.rootRenderTarget
. Then a call onrenderer.resize(width, height)
does the job. (It appears that updating resolution on the renderer only is not sufficient.)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.