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.2. Object disappearing when using the scrollwheel outside of running window Visibility Rect #34713

Open
golddotasksquestions opened this issue Dec 31, 2019 · 15 comments

Comments

@golddotasksquestions
Copy link

golddotasksquestions commented Dec 31, 2019

Godot version: 3.2 beta4

OS/device including version: Win7

Issue description:
When using the mouse scrollwheel outside of the running window, particles disappear. Moving the mouse back into the window area causes the particles to reappear. The scrollwheel has no affect if mouse is inside the running window. There is no input map assigned to the mouse scrollwheel. No code using the scrollwheel scancode. The issue is present when running the project from the editor as well as when running the exported project.
particles_scrollwheel

Steps to reproduce:
Run the minimal project and scroll inside vs outside the running window. Edit: Scroll beyond the Visibility Rect!

Minimal reproduction project:
particle_test_scrollwheel.zip

Godot4 Beta4 MRP:
scrollwheel_visibility_test.zip

@kyleguarco
Copy link

kyleguarco commented Dec 31, 2019

I cannot reproduce this issue on 3.2.beta.custom_build.406dac191 see below (commit 406dac1)

OS: Arch Linux, kernel 5.4.6-arch3-1
Graphics: Intel Integrated Graphics UHD 620 (Whiskey Lake)

edit Updated to the latest commit (from 5fa1905)

edit 2 After looking at the GIF again, I noticed a sharp frame drop when you dragged your mouse outside the screen. Though my frames don't drop when I do it, the particles do disappear if I forcefully reduce my physics frames to 30 (physics/common/physics_fps). Well, OK they don't disappear, they violently shake on the top left of the screen.

@golddotasksquestions
Copy link
Author

@FlashDaggerX The frame drop is just due to screen recording. When I don't screen record, then there is absolutely no frame dropping with this minimal project regardless of what I do.

@Xrayez
Copy link
Contributor

Xrayez commented Dec 31, 2019

Seems like particles visibility simply turns off when they go outside screen/viewport, that's an issue I'm experiencing for quite some time, for instance when a projectile with a smoke trail goes outside the screen. I think what is needed is calculating the bounding box of all particles before switching visibility completely, but since it's GPU accelerated not sure how feasible the solution might be.

@golddotasksquestions
Copy link
Author

@Xrayez If that's the case, why does are the particles then only disappearing when I use the scrollwheel outside of the viewport?

@Xrayez
Copy link
Contributor

Xrayez commented Dec 31, 2019

I couldn't reproduce either in latest build btw, it just may be connected to the issue in some way, not sure how scrollwheel could affect this. 👀

@Calinou
Copy link
Member

Calinou commented Jan 1, 2020

I think what is needed is calculating the bounding box of all particles before switching visibility completely, but since it's GPU accelerated not sure how feasible the solution might be.

With Particles2D, you can enlarge the AABB manually using Drawing > Visibility Rect in the inspector. With CPUParticles2D, the AABB is supposed to be computed automatically since Godot 3.1.

@Xrayez
Copy link
Contributor

Xrayez commented Jan 1, 2020

Thanks, yes it did solve my issue, not sure if this was present back in 2.1 last time I checked! I might have also misinterpreted this property as something which clips the drawing instead so I neglected it in the past...

@golddotasksquestions try to increase the visibility rect for the particles and see if this solves anything for some clues.

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Jan 1, 2020

@Xrayez You got it!
Changing the Visibility Rect does change the margin after which using the scrollwheel hides visibility of the particles.
I still don't understand why this happens, especially why the scrollwheel thing, but as long as you guys know what's going on I'm happy.

@Xrayez
Copy link
Contributor

Xrayez commented Jan 1, 2020

According to docs:

godot-particles-visibility-rect-docs

I wonder why it mentions editor specifically (misleading?). It may happen that editor input may affect particles in some way (with Sync Scene Changes option or similar), but I hardly see much connections in the source code.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 30, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

I can't reproduce either btw

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Dec 1, 2020

I can still reproduce it with the minimal project above. (both Godot 3.2.3 stable, 3.2.4 beta3)

@Calinou
Copy link
Member

Calinou commented Jul 5, 2021

I can't reproduce this with the included MRP on 3.3.2 on Linux.

Increasing the Visibility Rect in the Particles node should work around the issue in the meantime (tested by @ev1lbl0w).

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Jul 5, 2021

I can still reproduce it with the included MRP on 3.3.2 stable on Win.

Increasing the Visibility Rect works as a workaround but does not eliminate the issue.

@Calinou
Copy link
Member

Calinou commented Nov 4, 2022

@golddotasksquestions Can you (or anyone else) still reproduce this bug in Godot 4.0.beta4 or any later release? You can also check this again in 3.5.1 to make sure.

If yes, please ensure that a 4.0 up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Nov 10, 2022

@Calinou

Yes, I can still reproduce this on the same hardware. Also in Godot4 Beta4. I have converted the original MRP to Godot 4 Beta4 and added it to the original post.

While testing this again, I noticed not only the particles are disappearing, but the whole KinematicBody2D/CharacterBody2D the Particles2D are added to. So maybe this is not related to the Particles? I checked the above gif I made years ago, and even there it seems like the Sprite is disappearing, indicating the KB/CB is totally disappearing when scrolling outside, not just the Particles. That something I apparently did not notice before.

So I made two more small test scenes (one with CharacterBody2D and Sprite2D and one with only the Sprite), and the issue was present in both as long as they where moved to the global_mouse_position()

extends Sprite2D

func _process(delta):
	global_position = get_global_mouse_position()

Godot4 beta4 MRP:
scrollwheel_visibility_test.zip

@golddotasksquestions golddotasksquestions changed the title 3.2. Particles disappearing when using the scrollwheel outside of running window 3.2. Object disappearing when using the scrollwheel outside of running window Visibility Rect Nov 10, 2022
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

7 participants