Files
Bolsha9Kapl9/src/components/three/postprocessing/pass/FXAA.ts
T
2022-05-17 19:30:09 +09:00

21 lines
443 B
TypeScript

import { FXAAShader } from 'three-stdlib';
import { Size } from '@react-three/fiber';
import { BaseShader } from './Base';
export class FXAA extends BaseShader {
constructor() {
super(FXAAShader)
}
protected _initController = () => {}
update = (size: Size) => {
// validate pass
const pass = this.validatedPass()
if (!pass) return
// update uniforms
pass.uniforms.resolution.value.set(1 / size.width, 1 / size.height)
}
}