From d83fdf02753dca815ffde9d52d3176cbfe49c301 Mon Sep 17 00:00:00 2001 From: zsavicreative Date: Mon, 16 Apr 2018 11:59:52 +1000 Subject: [PATCH] r91 updates Updated XHRLoader deprecation to FileLoader to work with r91. And changed instanceof check due to thrown cannot register camera error even though camera instance was actually being passed through. --- src/ShaderRuntime.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ShaderRuntime.js b/src/ShaderRuntime.js index fd20efe..0044c17 100644 --- a/src/ShaderRuntime.js +++ b/src/ShaderRuntime.js @@ -43,7 +43,7 @@ ShaderRuntime.prototype = { let loadSource = ( index, source ) => { - let loader = new THREE.XHRLoader(); + let loader = new THREE.FileLoader(); loader.load( source, ( json ) => { let parsed; @@ -71,7 +71,7 @@ ShaderRuntime.prototype = { registerCamera( camera ) { - if( !( camera instanceof THREE.Camera ) ) { + if( !( camera.isCamera ) ) { throw new Error( 'Cannot register a non-camera as a camera!' ); } @@ -94,7 +94,7 @@ ShaderRuntime.prototype = { if( name in this.cubeCameras ) { delete this.cubeCameras[ name ]; - + } else if( name === this.mainCamera ) { delete this.mainCamera; @@ -174,7 +174,7 @@ ShaderRuntime.prototype = { newData.uniforms[ uniformName ].value = this.getUmap( uniform.glslType ); } } - + if( shaderName in this.shaderTypes ) { // maybe not needed? too sleepy, need document extend( this.shaderTypes[ shaderName ], newData );