- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2k
fixed when low fps cannot play particle #19013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed when low fps cannot play particle #19013
Conversation
| @cocos-robot run-test-cases-custom | 
| Code Size Check Report
 
 Interface Check ReportThis pull request does not change any public interfaces ! | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
    
      
        6 similar comments
      
    
  
    | @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @cocos-robot run test cases | 
    
      
        4 similar comments
      
    
  
    | @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @cocos-robot run test cases | 
        
          
                cocos/particle/particle-system.ts
              
                Outdated
          
        
      | // bursts | ||
| for (const burst of self.bursts) { | ||
| burst.update(self, dt); | ||
| if (timeLeft <= 0) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于 burst 中使用固定频率发射的粒子使用原来的逻辑
| if (self._time > startDelay) { | ||
| if (self._time > (self.duration + startDelay)) { | ||
| const timeLeft = self._time - (self.duration + startDelay); | ||
| if (timeLeft > dt) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于粒子系统已激活时间减去粒子可活动时间与延迟播放时间之后剩余的时间不足一帧的,允许播放一次粒子。
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @cocos-robot run test cases | 
    
      
        3 similar comments
      
    
  
    | @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @cocos-robot run test cases | 
| @zhefengzhang, Please check the result of  
 Task Details | 
| @zhefengzhang, Please check the result of  
 Task Details
 | 
| @zhefengzhang, Please check the result of  
 Task Details | 
| @zhefengzhang, Please check the result of  
 Task Details | 
| // bursts | ||
| for (const burst of self.bursts) { | ||
| burst.update(self, dt); | ||
| if (timeLeft <= 0 || self.loop) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于在 burst 中配置发射频率进行播放的粒子,使用原本的逻辑
Re: https://github.com/cocos/3d-tasks/issues/19127
当粒子系统的播放时间与粒子可存活的总时间相差小于一帧时,允许在当前帧尝试播放粒子,避免游戏低帧率时粒子系统因为卡顿错过了可用于播放粒子的帧。
When the playback time of the particle system differs from the total survival time of the particles by less than one frame, it is allowed to attempt to play the particles in the current frame to prevent the particle system from missing the frames available for playing the particles due to lag when the game has a low frame rate.
此修改同时解决了以下类似情况的粒子播放问题:
This modification also resolves the particle playback issues in the following similar scenarios: