提交 f4e2c793 编写于 作者: A angus

load cubemap mipmaps with level

上级 5be26401
......@@ -34,15 +34,18 @@
var path = 'textures/cube/angus/';
var format = '.jpg';
var mipmaps = [];
var maxLevel = 8;
async function loadCubeTexture( urls ) {
async function loadCubeTexture( urls, width ) {
return new Promise( function ( resolve, reject) {
new THREE.CubeTextureLoader().load( urls, function ( cubeTexture ) {
new THREE.CubeTextureLoader().load( urls,function ( cubeTexture ) {
resolve( cubeTexture );
}, function ( error ) {
} );
......@@ -53,7 +56,7 @@
// load mipmaps
var pendings = [];
for ( var level = 0; level < 9; ++ level ) {
for ( var level = 0; level <= maxLevel; ++ level ) {
var urls = [];
......@@ -63,9 +66,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.
先完成此消息的编辑!
想要评论请 注册