|
@@ -82,8 +82,6 @@ THREE.SAOPass = function ( scene, camera, depthTexture, useNormals, resolution )
|
|
this.saoMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
this.saoMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
this.saoMaterial.uniforms[ 'tNormal' ].value = this.normalRenderTarget.texture;
|
|
this.saoMaterial.uniforms[ 'tNormal' ].value = this.normalRenderTarget.texture;
|
|
this.saoMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
this.saoMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
- this.saoMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
- this.saoMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
|
|
this.saoMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.getInverse( this.camera.projectionMatrix );
|
|
this.saoMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.getInverse( this.camera.projectionMatrix );
|
|
this.saoMaterial.uniforms[ 'cameraProjectionMatrix' ].value = this.camera.projectionMatrix;
|
|
this.saoMaterial.uniforms[ 'cameraProjectionMatrix' ].value = this.camera.projectionMatrix;
|
|
this.saoMaterial.blending = THREE.NoBlending;
|
|
this.saoMaterial.blending = THREE.NoBlending;
|
|
@@ -103,8 +101,6 @@ THREE.SAOPass = function ( scene, camera, depthTexture, useNormals, resolution )
|
|
this.vBlurMaterial.defines[ 'DEPTH_PACKING' ] = this.supportsDepthTextureExtension ? 0 : 1;
|
|
this.vBlurMaterial.defines[ 'DEPTH_PACKING' ] = this.supportsDepthTextureExtension ? 0 : 1;
|
|
this.vBlurMaterial.uniforms[ 'tDiffuse' ].value = this.saoRenderTarget.texture;
|
|
this.vBlurMaterial.uniforms[ 'tDiffuse' ].value = this.saoRenderTarget.texture;
|
|
this.vBlurMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
this.vBlurMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
- this.vBlurMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
- this.vBlurMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
|
|
this.vBlurMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
this.vBlurMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
this.vBlurMaterial.blending = THREE.NoBlending;
|
|
this.vBlurMaterial.blending = THREE.NoBlending;
|
|
|
|
|
|
@@ -117,8 +113,6 @@ THREE.SAOPass = function ( scene, camera, depthTexture, useNormals, resolution )
|
|
this.hBlurMaterial.defines[ 'DEPTH_PACKING' ] = this.supportsDepthTextureExtension ? 0 : 1;
|
|
this.hBlurMaterial.defines[ 'DEPTH_PACKING' ] = this.supportsDepthTextureExtension ? 0 : 1;
|
|
this.hBlurMaterial.uniforms[ 'tDiffuse' ].value = this.blurIntermediateRenderTarget.texture;
|
|
this.hBlurMaterial.uniforms[ 'tDiffuse' ].value = this.blurIntermediateRenderTarget.texture;
|
|
this.hBlurMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
this.hBlurMaterial.uniforms[ 'tDepth' ].value = ( this.supportsDepthTextureExtension ) ? depthTexture : this.depthRenderTarget.texture;
|
|
- this.hBlurMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
- this.hBlurMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
|
|
this.hBlurMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
this.hBlurMaterial.uniforms[ 'size' ].value.set( this.resolution.x, this.resolution.y );
|
|
this.hBlurMaterial.blending = THREE.NoBlending;
|
|
this.hBlurMaterial.blending = THREE.NoBlending;
|
|
|
|
|
|
@@ -206,12 +200,19 @@ THREE.SAOPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ),
|
|
this.saoMaterial.uniforms[ 'scale' ].value = this.params.saoScale;
|
|
this.saoMaterial.uniforms[ 'scale' ].value = this.params.saoScale;
|
|
this.saoMaterial.uniforms[ 'kernelRadius' ].value = this.params.saoKernelRadius;
|
|
this.saoMaterial.uniforms[ 'kernelRadius' ].value = this.params.saoKernelRadius;
|
|
this.saoMaterial.uniforms[ 'minResolution' ].value = this.params.saoMinResolution;
|
|
this.saoMaterial.uniforms[ 'minResolution' ].value = this.params.saoMinResolution;
|
|
|
|
+ this.saoMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
+ this.saoMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
// this.saoMaterial.uniforms['randomSeed'].value = Math.random();
|
|
// this.saoMaterial.uniforms['randomSeed'].value = Math.random();
|
|
|
|
|
|
var depthCutoff = this.params.saoBlurDepthCutoff * ( this.camera.far - this.camera.near );
|
|
var depthCutoff = this.params.saoBlurDepthCutoff * ( this.camera.far - this.camera.near );
|
|
this.vBlurMaterial.uniforms[ 'depthCutoff' ].value = depthCutoff;
|
|
this.vBlurMaterial.uniforms[ 'depthCutoff' ].value = depthCutoff;
|
|
this.hBlurMaterial.uniforms[ 'depthCutoff' ].value = depthCutoff;
|
|
this.hBlurMaterial.uniforms[ 'depthCutoff' ].value = depthCutoff;
|
|
|
|
|
|
|
|
+ this.vBlurMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
+ this.vBlurMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
|
|
+ this.hBlurMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
|
|
|
|
+ this.hBlurMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
|
|
|
|
+
|
|
this.params.saoBlurRadius = Math.floor( this.params.saoBlurRadius );
|
|
this.params.saoBlurRadius = Math.floor( this.params.saoBlurRadius );
|
|
if ( ( this.prevStdDev !== this.params.saoBlurStdDev ) || ( this.prevNumSamples !== this.params.saoBlurRadius ) ) {
|
|
if ( ( this.prevStdDev !== this.params.saoBlurStdDev ) || ( this.prevNumSamples !== this.params.saoBlurRadius ) ) {
|
|
|
|
|