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

[3.x] 2D Particle hierarchical culling not working correctly #80086

Closed
lawnjelly opened this issue Jul 31, 2023 · 1 comment
Closed

[3.x] 2D Particle hierarchical culling not working correctly #80086

lawnjelly opened this issue Jul 31, 2023 · 1 comment

Comments

@lawnjelly
Copy link
Member

lawnjelly commented Jul 31, 2023

Godot version

3.6 (after #68738 merged)

System information

All

Issue description

2D particles are being culled when the parent object leaves the frame, when hierarchical culling is enabled.

culling_broken.mp4

Steps to reproduce

Create 2D particle system and move off screen with hierarchical culling enabled. Note that the particles disappear as soon as the origin moves off screen, rather than still showing the particles that have been emitted.

Minimal reproduction project

particle_hierarchical_culling.zip

Discussion

This is easy enough to fix in the meantime by turning off hierarchical culling (rendering/2D/options/culling_mode set to Item instead of Node).

I'm just fixing this now. The problem is the same as with skeletons - the bounding rect is changed by updates from the scene tree, and the local bound is never updated, so everything is culled from the parent object.

In the legacy item culling code, the bound is deferred updated when get_rect() is called on the item during the render traversal through the tree.

There's a number of ways to solve this, but I'll probably use something similar to skeletons, and trigger an update of the local bounds when the multimesh is changed (at least in the case of CPUParticles2D, haven't got to GPUparticles2D yet).

@lawnjelly lawnjelly added this to the 3.6 milestone Jul 31, 2023
@lawnjelly lawnjelly self-assigned this Jul 31, 2023
@lawnjelly lawnjelly changed the title 2D Particle hierarchical culling not working correctly [3.x] 2D Particle hierarchical culling not working correctly Jul 31, 2023
@akien-mga
Copy link
Member

Fixed by #80106.

@lawnjelly lawnjelly removed their assignment Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants