Skip to content

Commit ad929a4

Browse files
committed
Revert "Set transparent if canvas uses alpha"
This reverts commit abc7e35.
1 parent d45fdde commit ad929a4

2 files changed

Lines changed: 2 additions & 41 deletions

File tree

src/materials/EffectMaterial.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IUniform, NormalBlending, Texture, Uniform } from "three";
1+
import { IUniform, Texture, Uniform } from "three";
22
import { EffectShaderSection } from "../enums/EffectShaderSection.js";
33
import { EffectShaderSection as Section } from "../enums/EffectShaderSection.js";
44
import { ShaderDataTracker } from "../utils/ShaderDataTracker.js";
@@ -29,7 +29,6 @@ export class EffectMaterial extends FullscreenMaterial {
2929

3030
super({
3131
name: "EffectMaterial",
32-
blending: NormalBlending,
3332
defines: {
3433
COLOR_SPACE_CONVERSION: true
3534
},

src/passes/EffectPass.ts

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Event as Event3, Material, Texture, WebGLRenderer } 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";
@@ -76,19 +76,6 @@ export class EffectPass extends Pass<EffectMaterial> {
7676

7777
}
7878

79-
override get renderer(): WebGLRenderer | null {
80-
81-
return super.renderer;
82-
83-
}
84-
85-
override set renderer(value: WebGLRenderer | null) {
86-
87-
super.renderer = value;
88-
this.updateMaterialTransparency();
89-
90-
}
91-
9279
override get subpasses(): readonly Pass<Material | null>[] {
9380

9481
return super.subpasses;
@@ -202,7 +189,6 @@ export class EffectPass extends Pass<EffectMaterial> {
202189

203190
// Get the material for the current effect combination.
204191
this.fullscreenMaterial = this.effectMaterialManager.getMaterial(this.effects);
205-
this.updateMaterialTransparency();
206192

207193
// Pick up new materials.
208194
for(const material of this.effectMaterialManager.materials) {
@@ -213,24 +199,6 @@ export class EffectPass extends Pass<EffectMaterial> {
213199

214200
}
215201

216-
/**
217-
* Updates the fullscreen material to use alpha blending if needed.
218-
*/
219-
220-
private updateMaterialTransparency(): void {
221-
222-
if(this.renderer === null) {
223-
224-
return;
225-
226-
}
227-
228-
const alpha = this.renderer.getContext().getContextAttributes()?.alpha ?? false;
229-
const outputBuffer = this.output.defaultBuffer?.value ?? null;
230-
this.fullscreenMaterial.transparent = (alpha && outputBuffer === null);
231-
232-
}
233-
234202
/**
235203
* Updates the G-Buffer struct uniform.
236204
*/
@@ -373,12 +341,6 @@ export class EffectPass extends Pass<EffectMaterial> {
373341

374342
}
375343

376-
protected override onOutputChange(): void {
377-
378-
this.updateMaterialTransparency();
379-
380-
}
381-
382344
override checkRequirements(): void {
383345

384346
for(const effect of this.effects) {

0 commit comments

Comments
 (0)