|
@@ -87,10 +87,10 @@ var OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
|
|
|
var MAX_EDGE_GLOW = 4;
|
|
|
|
|
|
this.separableBlurMaterial1 = this.getSeperableBlurMaterial( MAX_EDGE_THICKNESS );
|
|
|
- this.separableBlurMaterial1.uniforms[ "texSize" ].value = new Vector2( resx, resy );
|
|
|
+ this.separableBlurMaterial1.uniforms[ "texSize" ].value.set( resx, resy );
|
|
|
this.separableBlurMaterial1.uniforms[ "kernelRadius" ].value = 1;
|
|
|
this.separableBlurMaterial2 = this.getSeperableBlurMaterial( MAX_EDGE_GLOW );
|
|
|
- this.separableBlurMaterial2.uniforms[ "texSize" ].value = new Vector2( Math.round( resx / 2 ), Math.round( resy / 2 ) );
|
|
|
+ this.separableBlurMaterial2.uniforms[ "texSize" ].value.set( Math.round( resx / 2 ), Math.round( resy / 2 ) );
|
|
|
this.separableBlurMaterial2.uniforms[ "kernelRadius" ].value = MAX_EDGE_GLOW;
|
|
|
|
|
|
// Overlay material
|
|
@@ -162,7 +162,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
this.renderTargetMaskDownSampleBuffer.setSize( resx, resy );
|
|
|
this.renderTargetBlurBuffer1.setSize( resx, resy );
|
|
|
this.renderTargetEdgeBuffer1.setSize( resx, resy );
|
|
|
- this.separableBlurMaterial1.uniforms[ "texSize" ].value = new Vector2( resx, resy );
|
|
|
+ this.separableBlurMaterial1.uniforms[ "texSize" ].value.set( resx, resy );
|
|
|
|
|
|
resx = Math.round( resx / 2 );
|
|
|
resy = Math.round( resy / 2 );
|
|
@@ -170,7 +170,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
this.renderTargetBlurBuffer2.setSize( resx, resy );
|
|
|
this.renderTargetEdgeBuffer2.setSize( resx, resy );
|
|
|
|
|
|
- this.separableBlurMaterial2.uniforms[ "texSize" ].value = new Vector2( resx, resy );
|
|
|
+ this.separableBlurMaterial2.uniforms[ "texSize" ].value.set( resx, resy );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -305,7 +305,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
// Make non selected objects invisible, and draw only the selected objects, by comparing the depth buffer of non selected objects
|
|
|
this.changeVisibilityOfNonSelectedObjects( false );
|
|
|
this.renderScene.overrideMaterial = this.prepareMaskMaterial;
|
|
|
- this.prepareMaskMaterial.uniforms[ "cameraNearFar" ].value = new Vector2( this.renderCamera.near, this.renderCamera.far );
|
|
|
+ this.prepareMaskMaterial.uniforms[ "cameraNearFar" ].value.set( this.renderCamera.near, this.renderCamera.far );
|
|
|
this.prepareMaskMaterial.uniforms[ "depthTexture" ].value = this.renderTargetDepthBuffer.texture;
|
|
|
this.prepareMaskMaterial.uniforms[ "textureMatrix" ].value = this.textureMatrix;
|
|
|
renderer.setRenderTarget( this.renderTargetMaskBuffer );
|
|
@@ -337,7 +337,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
// 3. Apply Edge Detection Pass
|
|
|
this.fsQuad.material = this.edgeDetectionMaterial;
|
|
|
this.edgeDetectionMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskDownSampleBuffer.texture;
|
|
|
- this.edgeDetectionMaterial.uniforms[ "texSize" ].value = new Vector2( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
|
+ this.edgeDetectionMaterial.uniforms[ "texSize" ].value.set( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
|
this.edgeDetectionMaterial.uniforms[ "visibleEdgeColor" ].value = this.tempPulseColor1;
|
|
|
this.edgeDetectionMaterial.uniforms[ "hiddenEdgeColor" ].value = this.tempPulseColor2;
|
|
|
renderer.setRenderTarget( this.renderTargetEdgeBuffer1 );
|
|
@@ -410,7 +410,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
uniforms: {
|
|
|
"depthTexture": { value: null },
|
|
|
"cameraNearFar": { value: new Vector2( 0.5, 0.5 ) },
|
|
|
- "textureMatrix": { value: new Matrix4() }
|
|
|
+ "textureMatrix": { value: null }
|
|
|
},
|
|
|
|
|
|
vertexShader: [
|