Skip to content

Commit

Permalink
Wind Waker: "Simple" particles can now access the framebuffer
Browse files Browse the repository at this point in the history
This is done almost the same as the game, but we modify the TEV settings at emitter creation time rather than at draw time (because generating the material is expensive)
  • Loading branch information
themikelester committed Jan 1, 2025
1 parent ee2103d commit 8b055af
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ZeldaWindWaker/d_particle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,20 @@ class dPa_simpleEcallBack extends JPAEmitterCallBack {
this.groupID = groupID;
this.baseEmitter = emitterManager.createEmitter(resData);
if(this.baseEmitter) {
this.baseEmitter.drawGroupId = groupID;
this.baseEmitter.emitterCallBack = this;
if(userID == 0xa06a || userID == 0xa410) {

// From dPa_simpleEcallBack::draw(). Fixup TEV settings for particles that access the framebuffer.
if (groupID == ParticleGroup.Projection) {
const m = resData.materialHelper.material;
m.tevStages[0].alphaInA = GX.CA.ZERO;
m.tevStages[0].alphaInB = GX.CA.ZERO;
m.tevStages[0].alphaInC = GX.CA.ZERO;
m.tevStages[0].alphaInD = GX.CA.A0;
resData.materialHelper.materialInvalidated();
}

if (userID == 0xa06a || userID == 0xa410) {
// TODO: Smoke callback
}
}
Expand Down

0 comments on commit 8b055af

Please sign in to comment.