Skip to content

Conversation

@zxx43
Copy link
Contributor

@zxx43 zxx43 commented Jan 12, 2022

Re: cocos-creator/3d-tasks#

Changelog:
*

particle-system.ts line 322 to 452 will reduce performance

@zxx43 zxx43 requested a review from pandamicro January 12, 2022 10:13
@github-actions
Copy link

github-actions bot commented Jan 12, 2022

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -51831,10 +51831,11 @@
             onRebuildPSO(index: number, material: Material): void;
             getParticleCount(): number;
             getFreeParticle(): _cocos_particle_particle__Particle | null;
             setNewParticle(p: _cocos_particle_particle__Particle): void;
-            updateRotation(): void;
-            updateScale(): void;
+            getDefaultMaterial(): Material | null;
+            updateRotation(pass: renderer.Pass | null): void;
+            updateScale(pass: renderer.Pass | null): void;
             updateParticles(dt: number): number;
             updateRenderData(): void;
             enableModule(name: string, val: boolean, pm: _cocos_particle_particle__IParticleModule): void;
             updateTrailMaterial(): void;

}

public updateRotation () {
public getPass(): Pass | null {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 pass 从外部传递不建议添加这个函数,应该暴露 defaultMaterial getter,然后在 ParticleSystem 直接获取到 material 的 pass 传递给 updateRotation

}

public updateRotation () {
public getPass(): Pass | null {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@pandamicro pandamicro merged commit 291ec8f into cocos:v3.4.1 Jan 12, 2022
@zxx43 zxx43 deleted the v3.4.1_performance branch September 16, 2022 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants