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
19 changes: 18 additions & 1 deletion examples/jsm/postprocessing/AfterimagePass.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AfterimagePass extends Pass {
*/
this.uniforms = UniformsUtils.clone( AfterimageShader.uniforms );

this.uniforms[ 'damp' ].value = damp;
this.damp = damp;

/**
* The composition material.
Expand Down Expand Up @@ -89,6 +89,23 @@ class AfterimagePass extends Pass {

}

/**
* The damping intensity, from 0.0 to 1.0. A higher value means a stronger after image effect.
*
* @type {number}
*/
get damp() {

return this.uniforms[ 'damp' ].value;

}

set damp( value ) {

this.uniforms[ 'damp' ].value = value;

}

/**
* Performs the after image pass.
*
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_postprocessing_afterimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
window.addEventListener( 'resize', onWindowResize );

const gui = new GUI( { title: 'Damp setting' } );
gui.add( afterimagePass.uniforms[ 'damp' ], 'value', 0, 1 ).step( 0.001 );
gui.add( afterimagePass, 'damp', 0, 1 ).step( 0.001 );
gui.add( params, 'enable' );

}
Expand Down