Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* visible.
*/
export class LowResRenderPass extends Pass {
private m_renderTarget: THREE.WebGLRenderTarget | null = null;
private readonly m_localCamera: THREE.OrthographicCamera = new THREE.OrthographicCamera(
-1,
1,
1,
-1,
0,
1
);
private readonly m_quadScene: THREE.Scene = new THREE.Scene();
private readonly m_quadUniforms: { [uniformName: string]: THREE.IUniform } =
CopyShader.uniforms;
private readonly m_quadMaterial: THREE.ShaderMaterial = new CopyMaterial(this.m_quadUniforms);
private readonly m_quad: THREE.Mesh = new THREE.Mesh(
new THREE.PlaneBufferGeometry(2, 2),
this.m_quadMaterial
);
private m_pixelRatio: number | undefined;
private m_savedWidth = 0;
private m_savedHeight = 0;
/**
* The constructor for `LowResRenderPass`. It builds an internal scene with a camera looking at
* a quad.
*
* @param lowResPixelRatio The `pixelRatio` determines the resolution of the internal
* `WebGLRenderTarget`. Values between 0.5 and `window.devicePixelRatio` can be tried to give
* good results. A value of `undefined` disables the low res render pass. The value should not
* be larger than`window.devicePixelRatio`.