From 3d6493eaca576d7d2869baf180b00b5eef2c2da8 Mon Sep 17 00:00:00 2001 From: Palash Bansal Date: Thu, 25 May 2023 22:53:47 +0530 Subject: [PATCH 1/2] Optional type fixes in Pass, add support for `WebGLMultipleRenderTargets`, Add render function in RenderPass and make properties optional. --- .../examples/jsm/postprocessing/Pass.d.ts | 10 ++++----- .../jsm/postprocessing/RenderPass.d.ts | 21 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/types/three/examples/jsm/postprocessing/Pass.d.ts b/types/three/examples/jsm/postprocessing/Pass.d.ts index 8fa609867..14f70d5a8 100644 --- a/types/three/examples/jsm/postprocessing/Pass.d.ts +++ b/types/three/examples/jsm/postprocessing/Pass.d.ts @@ -1,4 +1,4 @@ -import { Material, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three'; +import {Material, WebGLMultipleRenderTargets, WebGLRenderer, WebGLRenderTarget} from '../../../src/Three'; export class Pass { constructor(); @@ -12,10 +12,10 @@ export class Pass { setSize(width: number, height: number): void; render( renderer: WebGLRenderer, - writeBuffer: WebGLRenderTarget, - readBuffer: WebGLRenderTarget, - deltaTime: number, - maskActive: boolean, + writeBuffer: WebGLMultipleRenderTargets | WebGLRenderTarget | null, + readBuffer?: WebGLMultipleRenderTargets | WebGLRenderTarget, + deltaTime?: number, + maskActive?: boolean, ): void; dispose(): void; diff --git a/types/three/examples/jsm/postprocessing/RenderPass.d.ts b/types/three/examples/jsm/postprocessing/RenderPass.d.ts index 7e43df5d1..d8b547da3 100644 --- a/types/three/examples/jsm/postprocessing/RenderPass.d.ts +++ b/types/three/examples/jsm/postprocessing/RenderPass.d.ts @@ -1,13 +1,20 @@ -import { Scene, Camera, Material, Color } from '../../../src/Three'; - +import {Scene, Camera, Material, Color, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer} from '../../../src/Three'; import { Pass, FullScreenQuad } from './Pass'; export class RenderPass extends Pass { - constructor(scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: Color, clearAlpha?: number); - scene: Scene; - camera: Camera; - overrideMaterial: Material; - clearColor: Color; + constructor(scene?: Scene, camera?: Camera, overrideMaterial?: Material, clearColor?: Color, clearAlpha?: number); + scene?: Scene; + camera?: Camera; + overrideMaterial?: Material; + clearColor?: Color; clearAlpha: number; clearDepth: boolean; + + render( + renderer: WebGLRenderer, + _: WebGLMultipleRenderTargets | WebGLRenderTarget | null, + writeBuffer?: WebGLMultipleRenderTargets | WebGLRenderTarget, + deltaTime?: number, + maskActive?: boolean + ): void; } From 87882c3ebf07b318f57e2b639741b58662b5d0df Mon Sep 17 00:00:00 2001 From: Palash Bansal Date: Thu, 25 May 2023 23:23:38 +0530 Subject: [PATCH 2/2] Run prettier --- types/three/examples/jsm/postprocessing/Pass.d.ts | 2 +- .../examples/jsm/postprocessing/RenderPass.d.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/types/three/examples/jsm/postprocessing/Pass.d.ts b/types/three/examples/jsm/postprocessing/Pass.d.ts index 14f70d5a8..3d784c285 100644 --- a/types/three/examples/jsm/postprocessing/Pass.d.ts +++ b/types/three/examples/jsm/postprocessing/Pass.d.ts @@ -1,4 +1,4 @@ -import {Material, WebGLMultipleRenderTargets, WebGLRenderer, WebGLRenderTarget} from '../../../src/Three'; +import { Material, WebGLMultipleRenderTargets, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three'; export class Pass { constructor(); diff --git a/types/three/examples/jsm/postprocessing/RenderPass.d.ts b/types/three/examples/jsm/postprocessing/RenderPass.d.ts index d8b547da3..d44916f5d 100644 --- a/types/three/examples/jsm/postprocessing/RenderPass.d.ts +++ b/types/three/examples/jsm/postprocessing/RenderPass.d.ts @@ -1,4 +1,12 @@ -import {Scene, Camera, Material, Color, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer} from '../../../src/Three'; +import { + Scene, + Camera, + Material, + Color, + WebGLMultipleRenderTargets, + WebGLRenderTarget, + WebGLRenderer, +} from '../../../src/Three'; import { Pass, FullScreenQuad } from './Pass'; export class RenderPass extends Pass { @@ -15,6 +23,6 @@ export class RenderPass extends Pass { _: WebGLMultipleRenderTargets | WebGLRenderTarget | null, writeBuffer?: WebGLMultipleRenderTargets | WebGLRenderTarget, deltaTime?: number, - maskActive?: boolean + maskActive?: boolean, ): void; }