浏览代码

Stupid-proofed TextureCubeNode a little bit better

Daniel Sturk 6 年之前
父节点
当前提交
b1a14ec505
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/js/nodes/misc/TextureCubeNode.js

+ 2 - 1
examples/js/nodes/misc/TextureCubeNode.js

@@ -27,7 +27,8 @@ TextureCubeNode.prototype.generate = function ( builder, output ) {
 			uv_20 = this.uv.build( builder ) + '.uv_20',
 			t = this.uv.build( builder ) + '.t';
 
-		var format = this.value.value.encoding || THREE.LinearEncoding;
+		var texture = this.value && this.value.value;
+		var format = texture && texture.encoding || THREE.LinearEncoding;
 		var decoding = ColorSpaceNode.prototype.getDecodingMethod(format);
 		function decode(input) {
 			return decoding[0] + '( ' + input +