Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wind Waker: Particle system improvements (#739)
* Wind Waker: Split dPa_control_c init into common and scene * Wind Waker: Replace Particle.ts EffectDrawGroup with ParticleGroup * JPA: Fix misplaced `workData.volumeEmitCount = this.emitCount` Now `workData.volumeEmitCount` is always valid when it should be * Wind Waker: Introducing "simple" emitters The game uses these to consolidate commonly used emitters, such as flames. This fixes a big long-standing TODO in d_particle.ts, but the main goal is to fix the HACK related to indirect/projection particles * Wind Waker: "Simple" particles can now access the framebuffer 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) * Wind Waker: Fix common particles spawning once on scene creation * Formatting improvements * Wind Waker: d_a_ep now uses simple particles * Wind Waker: Small note regarding simple particles ignoring emitter translation * Wind Waker: Remove indirect particle hack Particles now keep the groupID that was assigned to them at creation. Projection particles are determined at simple emitter creation time, or if ParticleGroup.Projection is specified manually. * Wind Waker: Simple particle emitters are cleared every frame Actors such as d_a_ep must call `setSimple()` each frame * Wind Waker: Fixup d_a_ep (torch) actor. The default state now matches the game. * Wind Waker: Allow type 2 d_a_ep to render flames These should be handled by the d_a_lamp actor (e.g. in Beedle's ship shop), but that is not yet implemented. For now, let's handle them in d_a_ep * Wind Waker: Explicit return types for d_particle functions * Wind Waker: Fixed TODO - d_a_obj_flame now uses simple particle emitters * Wind Waker: Remove old `patchResData` indirect particles hack This TEV patching is now done in a more proper place, inside the the simple particle callback * Wind Waker: Add frustum culling for simple emitters * Wind Waker: Don't distance cull 2D/UI particle emitters * J2D: Add `J2DGrafContext.getFrustumForView()` Given a view matrix, return a Frustum which can be used for culling. In the original game, frustums are generated from proj matrices alone. Points were transformed by the view matrix before being tested against the frustum. But noclip typically expects viewProj frustums. * Wind Waker: Draw 2D/UI particle groups with ortho view/proj matrices * Wind Waker: Implement first 2D emitter for d_a_title * Wind Waker: Add sparkle emitter to d_a_title * Wind Waker: Add new drawlists for fore/background 2D particles This aligns with the game and fixes sorting issues with the title screen emitters * Wind Waker: Don't frustum cull 2D particles * Wind Waker: Use computeModelMatrixT to avoid list creation
- Loading branch information