mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
[webgl] Disable forced mipmaps in Safari.
This commit is contained in:
parent
ade13216b3
commit
7521838264
@ -396,12 +396,13 @@ module spine {
|
||||
|
||||
let config = this.config;
|
||||
|
||||
// Configure filtering.
|
||||
// Configure filtering, so not force mipmaps on Safari, they require POW2 textures
|
||||
let atlas = this.assetManager.require(config.atlasUrl);
|
||||
let gl = this.context.gl, anisotropic = gl.getExtension("EXT_texture_filter_anisotropic");
|
||||
let isSafari = navigator.vendor.match(/apple/i) && !navigator.userAgent.match(/crios/i) && !navigator.userAgent.match(/fxios/i);
|
||||
for (let page of atlas.pages) {
|
||||
let minFilter = page.minFilter;
|
||||
if (config.mipmaps) {
|
||||
if (!isSafari && config.mipmaps) {
|
||||
if (anisotropic) {
|
||||
gl.texParameterf(gl.TEXTURE_2D, anisotropic.TEXTURE_MAX_ANISOTROPY_EXT, 8);
|
||||
minFilter = TextureFilter.MipMapLinearLinear;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user