提交 00b4d7a9 编写于 作者: M Mugen87

ColladaLoader: Fixes #12530

上级 5a06b35c
......@@ -1393,12 +1393,27 @@ THREE.ColladaLoader.prototype = {
function getTexture( textureObject ) {
var sampler = effect.profile.samplers[ textureObject.id ];
var image;
// get image
if ( sampler !== undefined ) {
var surface = effect.profile.surfaces[ sampler.source ];
image = getImage( surface.init_from );
} else {
console.warn( 'THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530).' );
image = getImage( textureObject.id );
}
var texture = textureLoader.load( getImage( surface.init_from ) );
// create texture if image is avaiable
if ( image !== undefined ) {
var texture = textureLoader.load( image );
var extra = textureObject.extra;
......@@ -1421,14 +1436,16 @@ THREE.ColladaLoader.prototype = {
return texture;
}
} else {
console.error( 'THREE.ColladaLoader: Undefined sampler', textureObject.id );
console.error( 'THREE.ColladaLoader: Unable to load texture with ID:', textureObject.id );
return null;
}
}
var parameters = technique.parameters;
for ( var key in parameters ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册