-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Stop Particles3D to use ressources when not emitting (fixes #19507) #20338
Conversation
Could you rebase to squash the commits together? |
@akien-mga done (sorry, forgot to branch-away 😖) |
@reduz or anyone else who can answer: What do you think ? |
Well, PR is RFC. Also much easier to review using GitHub interface. |
@vnen ok 👍 |
4a462e1
to
b98a0b5
Compare
@@ -1410,6 +1410,9 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo | |||
RasterizerStorageGLES3::Particles *particles = static_cast<RasterizerStorageGLES3::Particles *>(e->owner); | |||
RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry); | |||
|
|||
if (!particles->emitting && particles->inactive) |
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.
This is way too low level, I think you should be able to stop the node from being added to render list by simply remove it it where you check in VisualServerScene. Check around that code, there is a bool you can toggle to get it removed
@@ -1796,6 +1796,8 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { | |||
} | |||
} | |||
|
|||
VisualServerRaster::redraw_request(); |
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.
I am not sure this is needed here
@@ -1886,7 +1886,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca | |||
//particles visible? process them | |||
VSG::storage->particles_request_process(ins->base); | |||
//particles visible? request redraw | |||
VisualServerRaster::redraw_request(); | |||
//VisualServerRaster::redraw_request(); |
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.
This was an ok place to avoid it from rendering if inactive, you can remove it from the render list
0f39ca2
to
9970340
Compare
Made some changes, in fact I went back to my first modification but at the time I thought it was too simple, and looked for something... "better" |
4fa642a
to
8ef916a
Compare
a4faedb
to
79eb777
Compare
…ne#19507) Do not add Particles to render list if not active (fixes godotengine#19507)
Hi, |
This PR prevents Particles3D to use resources when not emitting (issue #19507).
For the record, this does the same as my last PR #19764, but this time internally.