Browse Source

Stupid-proofed TextureCubeNode a little bit better

Daniel Sturk 6 years ago
parent
commit
b1a14ec505
1 changed files with 2 additions and 1 deletions
  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',
 			uv_20 = this.uv.build( builder ) + '.uv_20',
 			t = this.uv.build( builder ) + '.t';
 			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);
 		var decoding = ColorSpaceNode.prototype.getDecodingMethod(format);
 		function decode(input) {
 		function decode(input) {
 			return decoding[0] + '( ' + input +
 			return decoding[0] + '( ' + input +