Skip to content

Commit 02f1661

Browse files
committed
Remove renderer parameter
1 parent d71e8d6 commit 02f1661

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/core/Pass.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ export abstract class Pass<TMaterial extends Material | null = null>
430430

431431
if(value?.capabilities !== undefined) {
432432

433-
this.checkRequirements(value);
433+
this.checkRequirements();
434434

435435
}
436436

@@ -790,10 +790,9 @@ export abstract class Pass<TMaterial extends Material | null = null>
790790
* This method should throw an error if the requirements are not met.
791791
*
792792
* @throws If the device doesn't meet the requirements.
793-
* @param renderer - The current renderer.
794793
*/
795794

796-
checkRequirements(renderer: WebGLRenderer): void {}
795+
checkRequirements(): void {}
797796

798797
/**
799798
* Performs tasks when the input resources have changed.

src/passes/DepthDownsamplingPass.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FloatType, NearestFilter, WebGLRenderer, WebGLRenderTarget } from "three";
1+
import { FloatType, NearestFilter, WebGLRenderTarget } from "three";
22
import { TextureResource } from "../core/io/TextureResource.js";
33
import { Pass } from "../core/Pass.js";
44
import { GBuffer } from "../enums/GBuffer.js";
@@ -87,9 +87,15 @@ export class DepthDownsamplingPass extends Pass<DepthDownsamplingMaterial> {
8787

8888
}
8989

90-
override checkRequirements(renderer: WebGLRenderer): void {
90+
override checkRequirements(): void {
9191

92-
const gl = renderer.getContext();
92+
if(this.renderer === null) {
93+
94+
return;
95+
96+
}
97+
98+
const gl = this.renderer.getContext();
9399
const renderable = gl.getExtension("EXT_color_buffer_float") ?? gl.getExtension("EXT_color_buffer_half_float");
94100

95101
if(!renderable) {

src/passes/EffectPass.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Event as Event3, WebGLRenderer, Material, Texture } from "three";
1+
import { Event as Event3, Material, Texture } from "three";
22
import { Pass } from "../core/Pass.js";
33
import { Effect } from "../effects/Effect.js";
44
import { GBuffer } from "../enums/GBuffer.js";
@@ -353,11 +353,11 @@ export class EffectPass extends Pass<EffectMaterial> {
353353

354354
}
355355

356-
override checkRequirements(renderer: WebGLRenderer): void {
356+
override checkRequirements(): void {
357357

358358
for(const effect of this.effects) {
359359

360-
effect.checkRequirements(renderer);
360+
effect.checkRequirements();
361361

362362
}
363363

0 commit comments

Comments
 (0)