使用 CesiumJS 时出现如下错误信息WebGL: INVALID_VALUE: texImage2D: width or height out of range [.WebGL-0x58340100]RENDER WARNING: texture bound to texture unit 1 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?问题原因WebGL: INVALID_VALUE: texImage2D: width or height out of range这条错误信息表示传入的纹理宽度或高度超出了设备支持的最大纹理尺寸例如4096 x 4096、8192 x 8192[.WebGL-0x58340100]RENDER WARNING: texture bound to texture unit 1 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?这条错误信息表示绑定到纹理单元 1 的纹理无法用于渲染可能原因是非 2 的幂次尺寸例如256 x 256、512 x 512补充学习获取最大支持纹理尺寸functiongetMaxTextureSize(){constcanvasdocument.createElement(canvas);constglcanvas.getContext(webgl);returngl.getParameter(gl.MAX_TEXTURE_SIZE);}constmaxSizegetMaxTextureSize();console.log(最大支持纹理尺寸:${maxSize}px);
CesiumJS 问题:“WebGL: INVALID_VALUE: texImage2D: width or height out of range“
使用 CesiumJS 时出现如下错误信息WebGL: INVALID_VALUE: texImage2D: width or height out of range [.WebGL-0x58340100]RENDER WARNING: texture bound to texture unit 1 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?问题原因WebGL: INVALID_VALUE: texImage2D: width or height out of range这条错误信息表示传入的纹理宽度或高度超出了设备支持的最大纹理尺寸例如4096 x 4096、8192 x 8192[.WebGL-0x58340100]RENDER WARNING: texture bound to texture unit 1 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?这条错误信息表示绑定到纹理单元 1 的纹理无法用于渲染可能原因是非 2 的幂次尺寸例如256 x 256、512 x 512补充学习获取最大支持纹理尺寸functiongetMaxTextureSize(){constcanvasdocument.createElement(canvas);constglcanvas.getContext(webgl);returngl.getParameter(gl.MAX_TEXTURE_SIZE);}constmaxSizegetMaxTextureSize();console.log(最大支持纹理尺寸:${maxSize}px);