Browse Source

Fix regression with non-power-of-two equirectangular images.

This regression was introduced in 9788fc6512.
pull/1015/head
Matthew Petroff 3 years ago
parent
commit
4e069c768d
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/js/libpannellum.js

+ 3
- 2
src/js/libpannellum.js View File

@@ -483,8 +483,9 @@ function Renderer(container) {
}

// Set parameters for rendering any size
if (imageType != "cubemap" && image.width <= maxWidth && haov == 2 * Math.PI)
gl.texParameteri(glBindType, gl.TEXTURE_WRAP_S, gl.REPEAT);
if (imageType != "cubemap" && image.width <= maxWidth &&
haov == 2 * Math.PI && (image.width & (image.width - 1)) == 0)
gl.texParameteri(glBindType, gl.TEXTURE_WRAP_S, gl.REPEAT); // Only supported for power-of-two images in WebGL 1
else
gl.texParameteri(glBindType, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(glBindType, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);


Loading…
Cancel
Save