Kaynağa Gözat

Don't use WebGL for cubemaps in iOS due to bug with NPOT textures.

pull/57/head
Matthew Petroff 9 yıl önce
ebeveyn
işleme
0c05788b93
1 değiştirilmiş dosya ile 8 ekleme ve 3 silme
  1. +8
    -3
      src/js/libpannellum.js

+ 8
- 3
src/js/libpannellum.js Dosyayı Görüntüle

@@ -49,12 +49,17 @@ function Renderer(container, image, imageType, video) {
this.init = function(haov, vaov, voffset, callback) {
var s;
// Enable WebGL on canvas
gl = this.canvas.getContext('experimental-webgl', {alpha: false, depth: false});
// This awful browser specific test exists because iOS 8 (like IE 11)
// doesn't display non-power-of-two cubemap textures but also doesn't
// throw an error (tested on an iPhone 5c / iOS 8.1.3).
if (!(this.imageType == 'cubemap' && /(iphone|ipod|ipad).* os 8_/.test(navigator.userAgent.toLowerCase()))) {
// Enable WebGL on canvas
gl = this.canvas.getContext('experimental-webgl', {alpha: false, depth: false});
}
// If there is no WebGL, fall back to CSS 3D transform renderer.
// While browser specific tests are usually frowned upon, the
// fallback viewer only really works with WebKit/Blink
// fallback viewer only really works with WebKit/Blink.
if (!gl && ((this.imageType == 'multires' && this.image.fallbackPath) || this.imageType == 'cubemap') && 'WebkitAppearance' in document.documentElement.style) {
// Remove old world if it exists
if (this.world) {


Yükleniyor…
İptal
Kaydet