02-02-2024, 09:53 AM
(This post was last modified: 02-02-2024, 09:56 AM by josemendez.)
Hi there,
The compute backend requires adding/destroying particles at a specific point in the solver's update cycle, can't be emitted at any time. EmitParticle() and KillParticle() can only be called in the solver's OnSimulate event. This is because data on the CPU is sent to the GPU only once per frame, so modifying data on the CPU after it's been send to the GPU will result in both getting out of sync.
This isn't documented yet, so we'll make sure to mention it in the manual in the relevant places. We'll also look into adding a proper error message when attempting to do this.
thanks for reporting the issue!
The compute backend requires adding/destroying particles at a specific point in the solver's update cycle, can't be emitted at any time. EmitParticle() and KillParticle() can only be called in the solver's OnSimulate event. This is because data on the CPU is sent to the GPU only once per frame, so modifying data on the CPU after it's been send to the GPU will result in both getting out of sync.
This isn't documented yet, so we'll make sure to mention it in the manual in the relevant places. We'll also look into adding a proper error message when attempting to do this.
thanks for reporting the issue!