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

Canvas sources sized in exact powers of 2 (e.g. 512x512) render as black squares #9873

Closed
ryanhamley opened this issue Jul 15, 2020 · 6 comments
Labels

Comments

@ryanhamley
Copy link
Contributor

mapbox-gl-js version: starting from v0.50.0

browser: all

Steps to Trigger Behavior

  1. add a canvas source layer
  2. set the height and width to be an exact power of 2

Link to Demonstration

https://jsfiddle.net/rsh412/2exz0ukh/3/

Expected Behavior

https://jsfiddle.net/rsh412/wrtq3hpk/2/
Screen Shot 2020-07-14 at 4 57 10 PM

Actual Behavior

Screen Shot 2020-07-14 at 4 58 50 PM

The console shows many warnings [.WebGL-0x7f9a73693000]RENDER WARNING: texture bound to texture unit 1 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)? for both texture unit 1 and texture unit 0.

If you change the size of the canvas in the example from 256x256 to 256x257, the canvas renders as expected.

I tracked the introduction of the bug to 4e926e3.

@ryanhamley
Copy link
Contributor Author

cc @ansis

@Grooo
Copy link

Grooo commented Sep 28, 2020

Thanks!
I had been crazy all day with this mystery.
It doesn't seem to be resolved yet.

@kirrukirru
Copy link

kirrukirru commented Feb 16, 2021

Can we expect the resolution any time sooner?

@tavimori
Copy link

tavimori commented Sep 3, 2021

Debug for several nights and now I found this is an open issue...

@tavimori
Copy link

tavimori commented Sep 3, 2021

I found a workaround to this:

  1. Initially set the canvas to a non-power-of-2 size.
  2. After Mapbox render it once, resize the canvas won't trigger the bug.

CaviarChen added a commit to CaviarChen/fog-machine that referenced this issue Sep 6, 2021
@SnailBones
Copy link
Contributor

Same as #11132, fixed by #11162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants