提交 939bffd5 编写于 作者: T Takahiro

Set mapping property of envMap at proper timing in MMDLoader

上级 4e07f07f
......@@ -947,12 +947,6 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
t.wrapS = THREE.RepeatWrapping;
t.wrapT = THREE.RepeatWrapping;
if ( params.sphericalReflectionMapping === true ) {
t.mapping = THREE.SphericalReflectionMapping;
}
for ( var i = 0; i < texture.readyCallbacks.length; i++ ) {
texture.readyCallbacks[ i ]( texture );
......@@ -963,6 +957,12 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
}, onProgress, onError );
if ( params.sphericalReflectionMapping === true ) {
texture.mapping = THREE.SphericalReflectionMapping;
}
texture.readyCallbacks = [];
textures[ fullPath ] = texture;
......@@ -1258,13 +1258,6 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
m.envMap = getTexture( p.envMap, textures );
m.combine = p.envMapType;
// TODO: WebGLRenderer should automatically update?
m.envMap.readyCallbacks.push( function ( t ) {
m.needsUpdate = true;
} );
}
m.opacity = p.opacity;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册