Skip to content
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

Avoid updating particles during 2D rendering #70457

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

clayjohn
Copy link
Member

Fixes: #70431

tested with the MRPs from: #56691, #59072, #65443, #70431, and a few others I had on hand

This maintains the same behaviour for 3D (i.e. particles can be used the first frame that they are added to the scene), but for 2D we have to wait until the next frame. Particle update is requested so the particles will be updated before they are drawn again. This is necessary because in 2D the uniform set is not grabbed until rendering has started and you can't run a compute shader program while rendering is going on.

This bug didn't trigger when adding particles via the editor as they would get updated before drawing (i.e. at scene loading time).

In 2D the particle uniform set isn't obtained until the render pass. So in 2D just avoid rendering if not updated yet.
@clayjohn clayjohn added this to the 4.0 milestone Dec 22, 2022
@clayjohn clayjohn requested a review from a team as a code owner December 22, 2022 19:09
@akien-mga akien-mga merged commit 56b828e into godotengine:master Dec 23, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instantiating GPUParticles2D throws many errors
2 participants