You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
738 B
JavaScript
41 lines
738 B
JavaScript
2 months ago
|
import { FXAAShader } from '../shaders/FXAAShader.js';
|
||
|
import { ShaderPass } from './ShaderPass.js';
|
||
|
|
||
|
/**
|
||
|
* A pass for applying FXAA.
|
||
|
*
|
||
|
* ```js
|
||
|
* const fxaaPass = new FXAAPass();
|
||
|
* composer.addPass( fxaaPass );
|
||
|
* ```
|
||
|
*
|
||
|
* @augments ShaderPass
|
||
|
* @three_import import { FXAAPass } from 'three/addons/postprocessing/FXAAPass.js';
|
||
|
*/
|
||
|
class FXAAPass extends ShaderPass {
|
||
|
|
||
|
/**
|
||
|
* Constructs a new FXAA pass.
|
||
|
*/
|
||
|
constructor() {
|
||
|
|
||
|
super( FXAAShader );
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Sets the size of the pass.
|
||
|
*
|
||
|
* @param {number} width - The width to set.
|
||
|
* @param {number} height - The height to set.
|
||
|
*/
|
||
|
setSize( width, height ) {
|
||
|
|
||
|
this.material.uniforms[ 'resolution' ].value.set( 1 / width, 1 / height );
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
export { FXAAPass };
|