未验证 提交 03e97e79 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20888 from donmccurdy/bug-ktx2-mip-sizes

KTX2Loader: Fix calculation of level dimensions for NPOT textures.
......@@ -524,8 +524,8 @@ class KTX2Container {
for ( var level = 0; level < this.header.levelCount; level ++ ) {
var levelWidth = Math.ceil( width / Math.pow( 2, level ) );
var levelHeight = Math.ceil( height / Math.pow( 2, level ) );
var levelWidth = Math.max( 1, Math.floor( width / Math.pow( 2, level ) ) );
var levelHeight = Math.max( 1, Math.floor( height / Math.pow( 2, level ) ) );
var numImagesInLevel = 1; // TODO(donmccurdy): Support cubemaps, arrays and 3D.
var imageOffsetInLevel = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册