diff --git a/src/Common/JSYSTEM/J2Dv1.ts b/src/Common/JSYSTEM/J2Dv1.ts index 603555087..576fb1b5f 100644 --- a/src/Common/JSYSTEM/J2Dv1.ts +++ b/src/Common/JSYSTEM/J2Dv1.ts @@ -81,8 +81,6 @@ const enum J2DUVBinding { export class J2DGrafContext { private clipSpaceNearZ: GfxClipSpaceNearZ; - private frustum = new Frustum(); - public sceneParams = new SceneParams(); public viewport = vec4.create(); public ortho = vec4.create(); @@ -123,17 +121,6 @@ export class J2DGrafContext { } - /** - * noclip modification: - * Given a view matrix, return a Frustum which can be used for culling. - * In the original game, frustums are generated from proj matrices alone. But noclip expects viewProj frustums. - */ - public getFrustumForView(viewFromWorldMatrix: mat4): Frustum { - const clipFromWorldMatrix = mat4.mul(scratchMat, this.sceneParams.u_Projection, viewFromWorldMatrix); - this.frustum.updateClipFrustum(clipFromWorldMatrix, this.clipSpaceNearZ); - return this.frustum; - } - public setOnRenderInst(renderInst: GfxRenderInst): void { const d = renderInst.allocateUniformBufferF32(GX_Material.GX_Program.ub_SceneParams, ub_SceneParamsBufferSize); fillSceneParamsData(d, 0, this.sceneParams); diff --git a/src/ZeldaWindWaker/Main.ts b/src/ZeldaWindWaker/Main.ts index 0dd5309ac..68e80548b 100644 --- a/src/ZeldaWindWaker/Main.ts +++ b/src/ZeldaWindWaker/Main.ts @@ -420,11 +420,10 @@ export class WindWakerRenderer implements Viewer.SceneGfx { { const orthoCtx = this.globals.scnPlay.currentGrafPort; const viewMtx = mat4.fromTranslation(scratchMatrix, [orthoCtx.aspectRatioCorrection * 320, 240, 0]); - const frustum = orthoCtx.getFrustumForView(viewMtx); const template = renderInstManager.pushTemplate(); orthoCtx.setOnRenderInst(template); - globals.particleCtrl.setDrawInfo(viewMtx, orthoCtx.sceneParams.u_Projection, null, frustum); + globals.particleCtrl.setDrawInfo(viewMtx, orthoCtx.sceneParams.u_Projection, null, null); renderInstManager.setCurrentList(dlst.particle2DBack); globals.particleCtrl.draw(device, this.renderHelper.renderInstManager, ParticleGroup.TwoDback); diff --git a/src/ZeldaWindWaker/d_particle.ts b/src/ZeldaWindWaker/d_particle.ts index a1ea49b60..0161c261e 100644 --- a/src/ZeldaWindWaker/d_particle.ts +++ b/src/ZeldaWindWaker/d_particle.ts @@ -115,7 +115,7 @@ export class dPa_control_c { this.simpleCallbacks.push(simple); } - public setDrawInfo(posCamMtx: ReadonlyMat4, prjMtx: ReadonlyMat4, texPrjMtx: ReadonlyMat4 | null, frustum: Frustum): void { + public setDrawInfo(posCamMtx: ReadonlyMat4, prjMtx: ReadonlyMat4, texPrjMtx: ReadonlyMat4 | null, frustum: Frustum | null): void { this.drawInfo.posCamMtx = posCamMtx; this.drawInfo.texPrjMtx = texPrjMtx; this.drawInfo.frustum = frustum;