Ver código fonte

Editor: Fixed cubemaps.

Mr.doob 12 anos atrás
pai
commit
63e8599d65
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      editor/js/libs/ui.three.js

+ 2 - 2
editor/js/libs/ui.three.js

@@ -104,7 +104,7 @@ UI.CubeTexture = function ( position ) {
 
 	var scope = this;
 
-	this.texture = new THREE.Texture( [], new THREE.CubeReflectionMapping() );
+	this.texture = null;
 
 	this.dom = document.createElement( 'input' );
 	this.dom.type = 'file';
@@ -124,7 +124,7 @@ UI.CubeTexture = function ( position ) {
 				var image = document.createElement( 'img' );
 				image.addEventListener( 'load', function( event ) {
 
-					scope.texture.image = [ this, this, this, this, this, this ];
+					scope.texture = new THREE.Texture( [ this, this, this, this, this, this ], new THREE.CubeReflectionMapping() )
 					scope.texture.needsUpdate = true;
 
 					if ( scope.onChangeCallback ) scope.onChangeCallback();