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

Merge pull request #17286 from AngusLang/fix/load-cubemap-mipmaps-with-level

Examples: Load cubemap mipmaps with level
......@@ -28,12 +28,13 @@
init();
animate();
//load custmized cube texture
//load customized cube texture
async function loadCubeTextureWithMipmaps() {
var path = 'textures/cube/angus/';
var format = '.jpg';
var mipmaps = [];
var maxLevel = 8;
async function loadCubeTexture( urls ) {
......@@ -53,7 +54,7 @@
// load mipmaps
var pendings = [];
for ( var level = 0; level < 9; ++ level ) {
for ( var level = 0; level <= maxLevel; ++ level ) {
var urls = [];
......@@ -63,9 +64,11 @@
}
let mipmapLevel = level;
pendings.push( loadCubeTexture( urls ).then( function ( cubeTexture ) {
mipmaps.push( cubeTexture );
mipmaps[ mipmapLevel ] = cubeTexture;
} ) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册