Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/js/postprocessing/SSAOPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
depthTexture.minFilter = THREE.NearestFilter;
depthTexture.maxFilter = THREE.NearestFilter;

this.beautyRenderTarget = new THREE.WebGLRenderTarget( width, height, {
this.beautyRenderTarget = new THREE.WebGLRenderTarget( this.width, this.height, {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBAFormat,
Expand All @@ -45,15 +45,15 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {

// normal render target

this.normalRenderTarget = new THREE.WebGLRenderTarget( width, height, {
this.normalRenderTarget = new THREE.WebGLRenderTarget( this.width, this.height, {
minFilter: THREE.NearestFilter,
magFilter: THREE.NearestFilter,
format: THREE.RGBAFormat
} );

// ssao render target

this.ssaoRenderTarget = new THREE.WebGLRenderTarget( width, height, {
this.ssaoRenderTarget = new THREE.WebGLRenderTarget( this.width, this.height, {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBAFormat
Expand Down Expand Up @@ -84,7 +84,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
this.ssaoMaterial.uniforms[ 'kernel' ].value = this.kernel;
this.ssaoMaterial.uniforms[ 'cameraNear' ].value = this.camera.near;
this.ssaoMaterial.uniforms[ 'cameraFar' ].value = this.camera.far;
this.ssaoMaterial.uniforms[ 'resolution' ].value.set( width, height );
this.ssaoMaterial.uniforms[ 'resolution' ].value.set( this.width, this.height );
this.ssaoMaterial.uniforms[ 'cameraProjectionMatrix' ].value.copy( this.camera.projectionMatrix );
this.ssaoMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.getInverse( this.camera.projectionMatrix );

Expand All @@ -102,7 +102,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
fragmentShader: THREE.SSAOBlurShader.fragmentShader
} );
this.blurMaterial.uniforms[ 'tDiffuse' ].value = this.ssaoRenderTarget.texture;
this.blurMaterial.uniforms[ 'resolution' ].value.set( width, height );
this.blurMaterial.uniforms[ 'resolution' ].value.set( this.width, this.height );

// material for rendering the depth

Expand Down
5 changes: 4 additions & 1 deletion examples/webgl_postprocessing_ssao.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
stats = new Stats();
container.appendChild( stats.dom );

ssaoPass = new THREE.SSAOPass( scene, camera );
var width = window.innerWidth;
var height = window.innerHeight;

ssaoPass = new THREE.SSAOPass( scene, camera, width, height );
ssaoPass.renderToScreen = true;

effectComposer = new THREE.EffectComposer( renderer );
Expand Down