Lewy Blue %!s(int64=7) %!d(string=hai) anos
pai
achega
25b55a1244

+ 105 - 74
examples/js/loaders/FBXLoader.js

@@ -663,8 +663,8 @@
 
 			if ( 'Indexes' in subDeformerNode.subNodes ) {
 
-				subDeformer.indices = parseIntArray( subDeformerNode.subNodes.Indexes.properties.a );
-				subDeformer.weights = parseFloatArray( subDeformerNode.subNodes.Weights.properties.a );
+				subDeformer.indices = parseNumberArray( subDeformerNode.subNodes.Indexes.properties.a );
+				subDeformer.weights = parseNumberArray( subDeformerNode.subNodes.Weights.properties.a );
 
 			}
 
@@ -763,8 +763,8 @@
 
 		// First, each index is going to be its own vertex.
 
-		var vertexBuffer = parseFloatArray( subNodes.Vertices.properties.a );
-		var indexBuffer = parseIntArray( subNodes.PolygonVertexIndex.properties.a );
+		var vertexBuffer = parseNumberArray( subNodes.Vertices.properties.a );
+		var indexBuffer = parseNumberArray( subNodes.PolygonVertexIndex.properties.a );
 
 		if ( subNodes.LayerElementNormal ) {
 
@@ -1016,43 +1016,47 @@
 
 		}
 
-		// Convert the material indices of each vertex into rendering groups on the geometry.
+		if ( materialInfo.mappingType !== 'AllSame' ) {
 
-		var materialIndexBuffer = bufferInfo.materialIndexBuffer;
-		var prevMaterialIndex = materialIndexBuffer[ 0 ];
-		var startIndex = 0;
+			// Convert the material indices of each vertex into rendering groups on the geometry.
+			var materialIndexBuffer = bufferInfo.materialIndexBuffer;
+			var prevMaterialIndex = materialIndexBuffer[ 0 ];
+			var startIndex = 0;
 
-		for ( var i = 0; i < materialIndexBuffer.length; ++ i ) {
+			for ( var i = 0; i < materialIndexBuffer.length; ++ i ) {
 
-			if ( materialIndexBuffer[ i ] !== prevMaterialIndex ) {
+				if ( materialIndexBuffer[ i ] !== prevMaterialIndex ) {
 
-				geo.addGroup( startIndex, i - startIndex, prevMaterialIndex );
+					geo.addGroup( startIndex, i - startIndex, prevMaterialIndex );
 
-				prevMaterialIndex = materialIndexBuffer[ i ];
-				startIndex = i;
+					prevMaterialIndex = materialIndexBuffer[ i ];
+					startIndex = i;
+
+				}
 
 			}
 
-		}
+			// the loop above doesn't add the last group, do that here.
+			if ( geo.groups.length > 0 ) {
 
-		// the loop above doesn't add the last group, do that here.
-		if ( geo.groups.length > 0 ) {
+				var lastGroup = geo.groups[ geo.groups.length - 1 ];
+				var lastIndex = lastGroup.start + lastGroup.count;
 
-			var lastGroup = geo.groups[ geo.groups.length - 1 ];
-			var lastIndex = lastGroup.start + lastGroup.count;
+				if ( lastIndex !== materialIndexBuffer.length ) {
 
-			if ( lastIndex !== materialIndexBuffer.length ) {
+					geo.addGroup( lastIndex, materialIndexBuffer.length - lastIndex, prevMaterialIndex );
 
-				geo.addGroup( lastIndex, materialIndexBuffer.length - lastIndex, prevMaterialIndex );
+				}
 
 			}
 
-		}
+			// case where there are multiple materials but the whole geometry is only
+			// using one of them
+			if ( geo.groups.length === 0 ) {
 
-		// catch case where the whole geometry has a single non-zero index
-		if ( geo.groups.length === 0 && materialIndexBuffer[ 0 ] !== 0 ) {
+				geo.addGroup( 0, materialIndexBuffer.length, materialIndexBuffer[ 0 ] );
 
-			geo.addGroup( 0, materialIndexBuffer.length, materialIndexBuffer[ 0 ] );
+			}
 
 		}
 
@@ -1069,17 +1073,17 @@
 
 		var mappingType = NormalNode.properties.MappingInformationType;
 		var referenceType = NormalNode.properties.ReferenceInformationType;
-		var buffer = parseFloatArray( NormalNode.subNodes.Normals.properties.a );
+		var buffer = parseNumberArray( NormalNode.subNodes.Normals.properties.a );
 		var indexBuffer = [];
 		if ( referenceType === 'IndexToDirect' ) {
 
 			if ( 'NormalIndex' in NormalNode.subNodes ) {
 
-				indexBuffer = parseIntArray( NormalNode.subNodes.NormalIndex.properties.a );
+				indexBuffer = parseNumberArray( NormalNode.subNodes.NormalIndex.properties.a );
 
 			} else if ( 'NormalsIndex' in NormalNode.subNodes ) {
 
-				indexBuffer = parseIntArray( NormalNode.subNodes.NormalsIndex.properties.a );
+				indexBuffer = NormalNode.subNodes.NormalsIndex.properties.a;
 
 			}
 
@@ -1104,11 +1108,11 @@
 
 		var mappingType = UVNode.properties.MappingInformationType;
 		var referenceType = UVNode.properties.ReferenceInformationType;
-		var buffer = parseFloatArray( UVNode.subNodes.UV.properties.a );
+		var buffer = parseNumberArray( UVNode.subNodes.UV.properties.a );
 		var indexBuffer = [];
 		if ( referenceType === 'IndexToDirect' ) {
 
-			indexBuffer = parseIntArray( UVNode.subNodes.UVIndex.properties.a );
+			indexBuffer = parseNumberArray( UVNode.subNodes.UVIndex.properties.a );
 
 		}
 
@@ -1131,11 +1135,11 @@
 
 		var mappingType = ColorNode.properties.MappingInformationType;
 		var referenceType = ColorNode.properties.ReferenceInformationType;
-		var buffer = parseFloatArray( ColorNode.subNodes.Colors.properties.a );
+		var buffer = ColorNode.subNodes.Colors.properties.a;
 		var indexBuffer = [];
 		if ( referenceType === 'IndexToDirect' ) {
 
-			indexBuffer = parseFloatArray( ColorNode.subNodes.ColorIndex.properties.a );
+			indexBuffer = ColorNode.subNodes.ColorIndex.properties.a;
 
 		}
 
@@ -1171,7 +1175,7 @@
 
 		}
 
-		var materialIndexBuffer = parseIntArray( MaterialNode.subNodes.Materials.properties.a );
+		var materialIndexBuffer = parseNumberArray( MaterialNode.subNodes.Materials.properties.a );
 
 		// Since materials are stored as indices, there's a bit of a mismatch between FBX and what
 		// we expect.  So we create an intermediate buffer that points to the index in the buffer,
@@ -1359,9 +1363,9 @@
 
 		var degree = order - 1;
 
-		var knots = parseFloatArray( geometryNode.subNodes.KnotVector.properties.a );
+		var knots = geometryNode.subNodes.KnotVector.properties.a;
 		var controlPoints = [];
-		var pointsValues = parseFloatArray( geometryNode.subNodes.Points.properties.a );
+		var pointsValues = geometryNode.subNodes.Points.properties.a;
 
 		for ( var i = 0, l = pointsValues.length; i < l; i += 4 ) {
 
@@ -2615,6 +2619,7 @@
 
 			}
 			returnObject.curves.get( id )[ curveNode.attr ] = curveNode;
+
 			if ( curveNode.attr === 'R' ) {
 
 				var curves = curveNode.curves;
@@ -3011,11 +3016,11 @@
 			version: null,
 			id: animationCurve.id,
 			internalID: animationCurve.id,
-			times: parseFloatArray( animationCurve.subNodes.KeyTime.properties.a ).map( convertFBXTimeToSeconds ),
-			values: parseFloatArray( animationCurve.subNodes.KeyValueFloat.properties.a ),
+			times: parseNumberArray( animationCurve.subNodes.KeyTime.properties.a ).map( convertFBXTimeToSeconds ),
+			values: parseNumberArray( animationCurve.subNodes.KeyValueFloat.properties.a ),
 
-			attrFlag: parseIntArray( animationCurve.subNodes.KeyAttrFlags.properties.a ),
-			attrData: parseFloatArray( animationCurve.subNodes.KeyAttrDataFloat.properties.a )
+			attrFlag: parseNumberArray( animationCurve.subNodes.KeyAttrFlags.properties.a ),
+			attrData: animationCurve.subNodes.KeyAttrDataFloat.properties.a,
 		};
 
 	}
@@ -4305,6 +4310,43 @@
 
 			}
 
+			// ...parentName.properties.a
+			if ( propName === 'a' ) {
+
+				switch ( parentName ) {
+
+					case 'Matrix':
+					case 'TransformLink':
+					case 'Transform':
+						propValue = new THREE.Matrix4().fromArray( parseNumberArray( propValue ) );
+						break;
+
+					case 'ColorIndex':
+					case 'Colors':
+					case 'KeyAttrDataFloat':
+					case 'KnotVector':
+					case 'NormalIndex':
+					case 'NormalsIndex':
+					case 'Points':
+						propValue = parseNumberArray( propValue );
+						break;
+
+					// TODO: for the following properties this check is not catching all occurences
+					// case 'KeyTime':
+					// case 'Normals':
+					// case 'UV':
+					// case 'Vertices':
+					// case 'KeyValueFloat':
+					// case 'Weights':
+
+					// case 'Materials':
+					// case 'PolygonVertexIndex':
+					// case 'UVIndex':
+
+				}
+
+			}
+
 			// Connections
 			if ( propName === 'C' ) {
 
@@ -4344,7 +4386,6 @@
 			// already exists in properties, then append this
 			if ( propName in currentNode.properties ) {
 
-				// console.log( "duped entry found\nkey: " + propName + "\nvalue: " + propValue );
 				if ( Array.isArray( currentNode.properties[ propName ] ) ) {
 
 					currentNode.properties[ propName ].push( propValue );
@@ -4359,6 +4400,7 @@
 
 				if ( Array.isArray( currentNode.properties[ propName ] ) ) {
 
+
 					currentNode.properties[ propName ].push( propValue );
 
 				} else {
@@ -4427,7 +4469,7 @@
 				case 'Lcl_Translation':
 				case 'Lcl_Rotation':
 				case 'Lcl_Scaling':
-					innerPropValue = parseFloatArray( innerPropValue );
+					innerPropValue = parseNumberArray( innerPropValue );
 					break;
 
 			}
@@ -4590,9 +4632,20 @@
 						node.properties[ node.name ] = node.propertyList[ 0 ];
 						subNodes[ node.name ] = node;
 
-						// Later phase expects single property array is in node.properties.a as String.
-						// TODO: optimize
-						node.properties.a = value.toString();
+						switch ( node.name ) {
+
+							case 'Matrix':
+							case 'TransformLink':
+							case 'Transform':
+								node.properties.a = new THREE.Matrix4().fromArray( value );
+								break;
+
+							default:
+								node.properties.a = value;
+								break;
+
+						}
+
 
 					} else {
 
@@ -5442,40 +5495,24 @@
 	}
 
 	/**
-	 * Parses comma separated list of float numbers and returns them in an array.
+	 * Parses comma separated list of numbers and returns them in an array.
+	 * If an array is passed just return it - this is because the TextParser sometimes
+	 * returns strings instead of arrays, while the BinaryParser always returns arrays
+	 * TODO: this function should only need to be called from inside the TextParser
 	 * @example
 	 * // Returns [ 5.6, 9.4, 2.5, 1.4 ]
-	 * parseFloatArray( "5.6,9.4,2.5,1.4" )
+	 * parseNumberArray( "5.6,9.4,2.5,1.4" )
 	 * @returns {number[]}
 	 */
-	function parseFloatArray( string ) {
-
-		var array = string.split( ',' );
-
-		for ( var i = 0, l = array.length; i < l; i ++ ) {
-
-			array[ i ] = parseFloat( array[ i ] );
-
-		}
-
-		return array;
+	function parseNumberArray( value ) {
 
-	}
-
-	/**
-	 * Parses comma separated list of int numbers and returns them in an array.
-	 * @example
-	 * // Returns [ 5, 8, 2, 3 ]
-	 * parseFloatArray( "5,8,2,3" )
-	 * @returns {number[]}
-	 */
-	function parseIntArray( string ) {
+		if ( Array.isArray( value ) ) return value;
 
-		var array = string.split( ',' );
+		var array = value.split( ',' );
 
 		for ( var i = 0, l = array.length; i < l; i ++ ) {
 
-			array[ i ] = parseInt( array[ i ] );
+			array[ i ] = parseFloat( array[ i ] );
 
 		}
 
@@ -5505,12 +5542,6 @@
 
 	}
 
-	function parseMatrixArray( floatString ) {
-
-		return new THREE.Matrix4().fromArray( parseFloatArray( floatString ) );
-
-	}
-
 	/**
 	 * Converts ArrayBuffer to String.
 	 * @param {ArrayBuffer} buffer

+ 28 - 14
examples/js/loaders/LoaderSupport.js

@@ -891,7 +891,7 @@ THREE.LoaderSupport.WorkerRunnerRefImpl = (function () {
 	function WorkerRunnerRefImpl() {
 		var scope = this;
 		var scopedRunner = function( event ) {
-			scope.run( event.data );
+			scope.processMessage( event.data );
 		};
 		self.addEventListener( 'message', scopedRunner, false );
 	}
@@ -927,12 +927,15 @@ THREE.LoaderSupport.WorkerRunnerRefImpl = (function () {
 	 *
 	 * @param {Object} payload Raw mesh description (buffers, params, materials) used to build one to many meshes.
 	 */
-	WorkerRunnerRefImpl.prototype.run = function ( payload ) {
-		var logger = new ConsoleLogger( payload.logger.enabled, payload.logger.debug );
+	WorkerRunnerRefImpl.prototype.processMessage = function ( payload ) {
+		var logger = new ConsoleLogger();
+		if ( Validator.isValid( payload.logger ) ) {
 
-		if ( payload.cmd === 'run' ) {
+			logger.setEnabled( payload.logger.enabled );
+			logger.setDebug( payload.logger.debug );
 
-			logger.logInfo( 'WorkerRunner: Starting Run...' );
+		}
+		if ( payload.cmd === 'run' ) {
 
 			var callbacks = {
 				callbackBuilder: function ( payload ) {
@@ -948,7 +951,8 @@ THREE.LoaderSupport.WorkerRunnerRefImpl = (function () {
 			this.applyProperties( parser, payload.params );
 			this.applyProperties( parser, payload.materials );
 			this.applyProperties( parser, callbacks );
-			parser.parse( payload.buffers.input );
+			parser.workerScope = self;
+			parser.parse( payload.data.input, payload.data.options );
 
 			logger.logInfo( 'WorkerRunner: Run complete!' );
 
@@ -976,7 +980,7 @@ THREE.LoaderSupport.WorkerRunnerRefImpl = (function () {
  */
 THREE.LoaderSupport.WorkerSupport = (function () {
 
-	var WORKER_SUPPORT_VERSION = '1.1.0';
+	var WORKER_SUPPORT_VERSION = '1.1.1';
 
 	var Validator = THREE.LoaderSupport.Validator;
 
@@ -1046,11 +1050,17 @@ THREE.LoaderSupport.WorkerSupport = (function () {
 			var scope = this;
 			var buildWorkerCode = function ( baseWorkerCode ) {
 				scope.workerCode = baseWorkerCode;
+				if ( workerRunner == THREE.LoaderSupport.WorkerRunnerRefImpl ) {
+
+					scope.workerCode += buildObject( 'Validator', THREE.LoaderSupport.Validator );
+					scope.workerCode += buildSingelton( 'ConsoleLogger', 'ConsoleLogger', THREE.LoaderSupport.ConsoleLogger );
+
+				}
 				scope.workerCode += functionCodeBuilder( buildObject, buildSingelton );
 				scope.workerCode += buildSingelton( workerRunner.name, workerRunner.name, workerRunner );
 				scope.workerCode += 'new ' + workerRunner.name + '();\n\n';
 
-				var blob = new Blob( [ scope.workerCode ], { type: 'text/plain' } );
+				var blob = new Blob( [ scope.workerCode ], { type: 'application/javascript' } );
 				scope.worker = new Worker( window.URL.createObjectURL( blob ) );
 				scope.logger.logTimeEnd( 'buildWebWorkerCode' );
 
@@ -1059,10 +1069,8 @@ THREE.LoaderSupport.WorkerSupport = (function () {
 
 					switch ( payload.cmd ) {
 						case 'meshData':
-							scope.callbacks.builder( payload );
-							break;
-
 						case 'materialData':
+						case 'imageData':
 							scope.callbacks.builder( payload );
 							break;
 
@@ -1072,14 +1080,18 @@ THREE.LoaderSupport.WorkerSupport = (function () {
 
 							if ( scope.terminateRequested ) {
 
-								scope.logger.logInfo( 'WorkerSupport: Run is complete. Terminating application on request!' );
+								scope.logger.logInfo( 'WorkerSupport [' + workerRunner + ']: Run is complete. Terminating application on request!' );
 								scope.terminateWorker();
 
 							}
 							break;
 
+						case 'error':
+							scope.logger.logError( 'WorkerSupport [' + workerRunner + ']: Reported error: ' + payload.msg );
+							break;
+
 						default:
-							scope.logger.logError( 'WorkerSupport: Received unknown command: ' + payload.cmd );
+							scope.logger.logError( 'WorkerSupport [' + workerRunner + ']: Received unknown command: ' + payload.cmd );
 							break;
 
 					}
@@ -1183,6 +1195,7 @@ THREE.LoaderSupport.WorkerSupport = (function () {
 	var buildSingelton = function ( fullName, internalName, object ) {
 		var objectString = fullName + ' = (function () {\n\n';
 		objectString += '\t' + object.prototype.constructor.toString() + '\n\n';
+		objectString = objectString.replace( object.name, internalName );
 
 		var funcString;
 		var objectPart;
@@ -1223,8 +1236,9 @@ THREE.LoaderSupport.WorkerSupport = (function () {
 		if ( ! Validator.isValid( this.callbacks.builder ) ) throw 'Unable to run as no "builder" callback is set.';
 		if ( ! Validator.isValid( this.callbacks.onLoad ) ) throw 'Unable to run as no "onLoad" callback is set.';
 		if ( Validator.isValid( this.worker ) || this.loading ) {
-			this.running = true;
+			if ( payload.cmd !== 'run' ) payload.cmd = 'run';
 			this.queuedMessage = payload;
+			this.running = true;
 			this._postMessage();
 
 		}

+ 15 - 18
examples/js/loaders/OBJLoader2.js

@@ -16,7 +16,7 @@ if ( THREE.OBJLoader2 === undefined ) { THREE.OBJLoader2 = {} }
  */
 THREE.OBJLoader2 = (function () {
 
-	var OBJLOADER2_VERSION = '2.1.0';
+	var OBJLOADER2_VERSION = '2.1.1';
 	var LoaderBase = THREE.LoaderSupport.LoaderBase;
 	var Validator = THREE.LoaderSupport.Validator;
 	var ConsoleLogger = THREE.LoaderSupport.ConsoleLogger;
@@ -254,12 +254,10 @@ THREE.OBJLoader2 = (function () {
 		var buildCode = function ( funcBuildObject, funcBuildSingelton ) {
 			var workerCode = '';
 			workerCode += '/**\n';
-			workerCode += '  * This code was constructed by OBJLoader2 buildWorkerCode.\n';
+			workerCode += '  * This code was constructed by OBJLoader2 buildCode.\n';
 			workerCode += '  */\n\n';
 			workerCode += funcBuildSingelton( 'LoaderBase', 'LoaderBase', LoaderBase );
 			workerCode += funcBuildObject( 'Consts', Consts );
-			workerCode += funcBuildObject( 'Validator', Validator );
-			workerCode += funcBuildSingelton( 'ConsoleLogger', 'ConsoleLogger', ConsoleLogger );
 			workerCode += funcBuildSingelton( 'Parser', 'Parser', Parser );
 			workerCode += funcBuildSingelton( 'RawMesh', 'RawMesh', RawMesh );
 			workerCode += funcBuildSingelton( 'RawMeshSubGroup', 'RawMeshSubGroup', RawMeshSubGroup );
@@ -278,7 +276,6 @@ THREE.OBJLoader2 = (function () {
 		}
 		this.workerSupport.run(
 			{
-				cmd: 'run',
 				params: {
 					useAsync: true,
 					materialPerSmoothingGroup: this.materialPerSmoothingGroup,
@@ -293,8 +290,9 @@ THREE.OBJLoader2 = (function () {
 					// in async case only material names are supplied to parser
 					materials: materialNames
 				},
-				buffers: {
-					input: content
+				data: {
+					input: content,
+					options: null
 				}
 			},
 			[ content.buffer ]
@@ -561,7 +559,7 @@ THREE.OBJLoader2 = (function () {
 							throw 'Vertex Colors were detected, but vertex count and color count do not match!';
 
 						}
-						this.processCompletedObject( null, this.rawMesh.groupName, currentByte );
+						this.processCompletedObject( this.rawMesh.objectName, this.rawMesh.groupName, currentByte );
 						reachedFaces = false;
 
 					}
@@ -600,20 +598,13 @@ THREE.OBJLoader2 = (function () {
 
 				case Consts.LINE_G:
 					this.processCompletedGroup( concatStringBuffer( buffer, bufferPointer, slashSpacePattern ), currentByte );
+					reachedFaces = false;
 					flushStringBuffer( buffer, bufferPointer );
 					break;
 
 				case Consts.LINE_O:
-					if ( this.rawMesh.vertices.length > 0 ) {
-
-						this.processCompletedObject( concatStringBuffer( buffer, bufferPointer, slashSpacePattern ), null, currentByte );
+					this.processCompletedObject( concatStringBuffer( buffer, bufferPointer, slashSpacePattern ), this.rawMesh.groupName, currentByte );
 						reachedFaces = false;
-
-					} else {
-
-						this.rawMesh.pushObject( concatStringBuffer( buffer, bufferPointer, slashSpacePattern ) );
-
-					}
 					flushStringBuffer( buffer, bufferPointer );
 					break;
 
@@ -656,9 +647,15 @@ THREE.OBJLoader2 = (function () {
 				this.buildMesh( result, currentByte );
 				var progressBytesPercent = currentByte / this.totalBytes;
 				this.callbackProgress( 'Completed object: ' + objectName + ' Total progress: ' + ( progressBytesPercent * 100 ).toFixed( 2 ) + '%', progressBytesPercent );
+			this.rawMesh = this.rawMesh.newInstanceFromObject( objectName, groupName );
+
+			} else {
+
+				// if a object was set that did not lead to object creation in finalize, then the object name has to be updated
+				this.rawMesh.pushObject( objectName );
 
 			}
-			this.rawMesh = this.rawMesh.newInstanceFromObject( objectName, groupName );
+
 		};
 
 		Parser.prototype.processCompletedGroup = function ( groupName, currentByte ) {

+ 6 - 5
examples/webgl_loader_obj2.html

@@ -139,14 +139,14 @@
 
 				OBJLoader2Example.prototype.initContent = function () {
 					var modelName = 'female02';
-					this._reportProgress( 'Loading: ' + modelName );
+					this._reportProgress( { detail: { text: 'Loading: ' + modelName } } );
 
 					var scope = this;
 					var objLoader = new THREE.OBJLoader2();
 					var callbackOnLoad = function ( event ) {
 						scope.scene.add( event.detail.loaderRootNode );
 						console.log( 'Loading complete: ' + event.detail.modelName );
-						scope._reportProgress( '' );
+						scope._reportProgress( { detail: { text: '' } } );
 					};
 
 					var onLoadMtl = function ( materials ) {
@@ -160,9 +160,10 @@
 					objLoader.loadMtl( 'obj/female02/female02.mtl', 'female02.mtl', null, onLoadMtl );
 				};
 
-				OBJLoader2Example.prototype._reportProgress = function( content ) {
-					console.log( 'Progress: ' + content );
-					document.getElementById( 'feedback' ).innerHTML = Validator.isValid( content ) ? content : '';
+				OBJLoader2Example.prototype._reportProgress = function( event ) {
+					var output = Validator.verifyInput( event.detail.text, '' );
+					console.log( 'Progress: ' + output );
+					document.getElementById( 'feedback' ).innerHTML = output;
 				};
 
 				OBJLoader2Example.prototype.resizeDisplayGL = function () {

+ 4 - 6
examples/webgl_loader_obj2_meshspray.html

@@ -140,10 +140,8 @@
 					var buildCode = function ( funcBuildObject, funcBuildSingelton ) {
 						var workerCode = '';
 						workerCode += '/**\n';
-						workerCode += '  * This code was constructed by MeshSpray buildWorkerCode.\n';
+						workerCode += '  * This code was constructed by MeshSpray buildCode.\n';
 						workerCode += '  */\n\n';
-						workerCode += funcBuildObject( 'Validator', Validator );
-						workerCode += funcBuildSingelton( 'ConsoleLogger', 'ConsoleLogger', ConsoleLogger );
 						workerCode += funcBuildSingelton( 'Parser', 'Parser', Parser );
 
 						return workerCode;
@@ -153,7 +151,6 @@
 					this.workerSupport.setCallbacks( scopeBuilderFunc, scopeFuncComplete );
 					this.workerSupport.run(
 						{
-							cmd: 'run',
 							params: {
 								dimension: prepData.dimension,
 								quantity: prepData.quantity,
@@ -166,8 +163,9 @@
 								debug: this.logger.debug,
 								enabled: this.logger.enabled
 							},
-							buffers: {
-								input: null
+							data: {
+								input: null,
+								options: null
 							}
 						}
 					);

+ 2 - 0
src/textures/VideoTexture.js

@@ -14,6 +14,8 @@ function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, forma
 
 	function update() {
 
+		var video = scope.image;
+
 		if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 
 			scope.needsUpdate = true;