From bcb9cb9266a021c152ecc43685ae5b284398dd89 Mon Sep 17 00:00:00 2001 From: "Raoul v. R." Date: Sat, 4 Jan 2025 22:22:30 +0100 Subject: [PATCH] Use default parameter --- src/core/Pass.ts | 2 +- src/passes/BufferDebugPass.ts | 2 +- src/passes/ClearPass.ts | 2 +- src/passes/CopyPass.ts | 2 +- src/passes/EffectPass.ts | 2 +- src/passes/GeometryPass.ts | 2 +- src/passes/ShaderPass.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/Pass.ts b/src/core/Pass.ts index 909b4e216..440afd938 100644 --- a/src/core/Pass.ts +++ b/src/core/Pass.ts @@ -880,7 +880,7 @@ export abstract class Pass * @param activeMipmapLevel - Specifies the active mipmap level. */ - protected setRenderTarget(renderTarget: WebGLRenderTarget | WebGLRenderTarget | null, + protected setRenderTarget(renderTarget: WebGLRenderTarget | WebGLRenderTarget | null = null, activeCubeFace?: number, activeMipmapLevel?: number): void { this.renderer?.setRenderTarget(renderTarget, activeCubeFace, activeMipmapLevel); diff --git a/src/passes/BufferDebugPass.ts b/src/passes/BufferDebugPass.ts index b829033e6..cd08fdbd4 100644 --- a/src/passes/BufferDebugPass.ts +++ b/src/passes/BufferDebugPass.ts @@ -258,7 +258,7 @@ export class BufferDebugPass extends Pass { override render(): void { - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); this.renderFullscreen(); this.renderer?.render(this.debugScene, this.debugCamera); diff --git a/src/passes/ClearPass.ts b/src/passes/ClearPass.ts index 978740759..634437a1f 100644 --- a/src/passes/ClearPass.ts +++ b/src/passes/ClearPass.ts @@ -211,7 +211,7 @@ export class ClearPass extends Pass { const background = this.scene?.background ?? null; const hasOverrideClearColor = this.clearValues.color !== null; - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); if(!hasOverrideClearColor && this.camera !== null && background !== null) { diff --git a/src/passes/CopyPass.ts b/src/passes/CopyPass.ts index 04a165b6f..65f6685f7 100644 --- a/src/passes/CopyPass.ts +++ b/src/passes/CopyPass.ts @@ -133,7 +133,7 @@ export class CopyPass extends Pass { if(!this.blit()) { // Blit failed: use a shader to copy the input buffer. - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); this.renderFullscreen(); } diff --git a/src/passes/EffectPass.ts b/src/passes/EffectPass.ts index e406aae69..5ecde3766 100644 --- a/src/passes/EffectPass.ts +++ b/src/passes/EffectPass.ts @@ -351,7 +351,7 @@ export class EffectPass extends Pass { const material = this.fullscreenMaterial; material.time += this.timer.getDelta() * this.timeScale; - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); this.renderFullscreen(); } diff --git a/src/passes/GeometryPass.ts b/src/passes/GeometryPass.ts index 9f1e279f2..fa29de108 100644 --- a/src/passes/GeometryPass.ts +++ b/src/passes/GeometryPass.ts @@ -646,7 +646,7 @@ export class GeometryPass extends Pass implements Selective { } - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); renderer.render(scene, camera); // Restore the original values. diff --git a/src/passes/ShaderPass.ts b/src/passes/ShaderPass.ts index 9d906ca5d..7675a29da 100644 --- a/src/passes/ShaderPass.ts +++ b/src/passes/ShaderPass.ts @@ -52,7 +52,7 @@ export class ShaderPass exten override render(): void { - this.setRenderTarget(this.output.defaultBuffer?.value ?? null); + this.setRenderTarget(this.output.defaultBuffer?.value); this.renderFullscreen(); }