Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f95d07

Browse files
committed
Refresh G-Buffer components on effect change
1 parent6747ab9 commit1f95d07

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

‎src/passes/EffectPass.ts‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ export class EffectPass extends Pass<EffectMaterial> {
9595

9696
for(consteffectofsuper.subpasses){
9797

98-
for(constgBufferComponentofeffect.input.gBuffer){
99-
100-
this.input.gBuffer.add(gBufferComponent);
101-
102-
}
98+
this.copyGBufferComponents(effectasEffect);
10399

104100
effect.addEventListener("change",this.effectListener);
105101
effect.addEventListener("toggle",this.effectListener);
@@ -154,6 +150,22 @@ export class EffectPass extends Pass<EffectMaterial> {
154150

155151
}
156152

153+
/**
154+
* Copies the G-Buffer components of the given effect.
155+
*
156+
*@param effect - The effect.
157+
*/
158+
159+
privatecopyGBufferComponents(effect:Effect):void{
160+
161+
for(constgBufferComponentofeffect.input.gBuffer){
162+
163+
this.input.gBuffer.add(gBufferComponent);
164+
165+
}
166+
167+
}
168+
157169
/**
158170
* Updates the fullscreen material based on the current effect combination.
159171
*
@@ -227,6 +239,7 @@ export class EffectPass extends Pass<EffectMaterial> {
227239
switch(e.type){
228240

229241
case"change":
242+
this.copyGBufferComponents(e.targetasEffect);
230243
this.effectMaterialManager.invalidateShaderData(e.targetasEffect);
231244
this.updateMaterial(true);
232245
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp