mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.22k stars 718 forks source link

Multires rendering breaks after resize on Chrome / OSX #267

Open bikubi opened 7 years ago

bikubi commented 7 years ago

Looks like this: pannellu-resize-bug

Affects, as far as I can tell

I know this is pretty narrow/specific, but to me important. I'm thinking of targeting/sniffing Chrome on OSX and somehow forcing the fallback version, as cubemap and equirectangular are fine...

Very likely related to #266 and #248. I've come across the artifacts shown in the latter issue, but haven't reproduced them since.

And yet another update, sorry: as in #266, I just tried an old Chromium (37.0.2033.0), which works just fine.

mpetroff commented 7 years ago

Does the WebGL test page work? As this rendering artifact only happens with the CSS 3D transform-based fallback renderer, it is clearly being used.

bikubi commented 7 years ago

Thank you for your reply! Yeah, the test page does work. I'm not sure if it's relevant - I can see it loading/using multiple resolutions, and the level tiles pop up in the Network Panel as i zoom around...

mpetroff commented 7 years ago

This is really odd then; I've never seen this happen with WebGL before. If you open chrome://gpu/, what does it say under Graphics Feature Status for WebGL? I'm wondering whether it's using software rendering.

bikubi commented 7 years ago

On both machines (broken & working) it says "WebGL: Hardware accelerated". I've put both complete outputs in a gist, here's a htmlpreview...

What I've naively noticed is thousands of Log Messages on the broken system: YUV_420_BIPLANAR requires GL_TEXTURE_RECTANGLE_ARB target

mpetroff commented 7 years ago

The best I can tell, it's a bug in the WebGL implementation. I'm not sure what I can do about it. Without direct access to a machine that displays this issue, it will be next to impossible for me to debug the problem.

bikubi commented 7 years ago

Yeah, I had a feeling it was something like that :) For the record and for whomever might need to work around this, here's the gist of my setup. Chromes on OSX get a multires config - that's too greedy, but I have no idea how to detect a broken WebGL / specific type of Mac.

var pannellum_cfg = {
  multiRes: {
    //...
  },
  //...
  cubeMap: ['fallback/f.jpg', 'fallback/r.jpg', '...'],
  basePath: '...',
  type: ((navigator.platform.indexOf('Mac') > -1) && !!window.chrome && !!window.chrome.webstore)
    ? 'cubemap'
    : 'multires'
};

It's basically the multires and cubemap configs merged into one object, with a browser-and-OS-sniffing type property.

Or make the container's width absolute ;)

bikubi commented 7 years ago

By the way, the closed source Pano2VR shows a similar behavior in its HTML5 mode. I'd post screenshots, but they end up pretty boring (all white) - check out their examples (currently the "Beta" ones are HTML5), and resize the window.