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

Parallax2D's Sprite2D child stops rendering while scaled and zoomed on #92705

Closed
paflya opened this issue Jun 2, 2024 · 2 comments · Fixed by #92763
Closed

Parallax2D's Sprite2D child stops rendering while scaled and zoomed on #92705

paflya opened this issue Jun 2, 2024 · 2 comments · Fixed by #92763

Comments

@paflya
Copy link

paflya commented Jun 2, 2024

Tested versions

  • Reproductive in: 4.3 beta 1

System information

Godot v4.3.beta1 - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.5176) - AMD Ryzen 5 1600 Six-Core Processor (12 Threads)

Issue description

The Sprite2D node stops rendering in the scene in Editor/in Game while being a child to Parallax2D node under these conditions:

  • Parallax2D's repeat_times property is more than 1
  • Parallax2D's repeat_size is big enough to make children spaced out from each other
  • Childs Sprite2D scale property under Node2D is bigger than 2 (in my tests around 2,5 - 3)

While all of these apply, zooming to the origin of Sprite2D will result in it not rendering. That happens on less levels of zoom when the repeat_time in Parallax2D is bigger. Propably has something to do with all repetitions not in view.
Oddly enough, zooming to the edges of repetition will be okay.

Steps to reproduce

Included minimal reproduction project. Also includind the video of the problem captured in MRP.

To reproduce the problem:

  1. Open the project or/ recreate the conditions described in the issue description.
  2. Zoom in on the Sprite2D origin

Minimal reproduction project (MRP)

parallax2d-mrp.zip

@markdibarry
Copy link
Contributor

markdibarry commented Jun 2, 2024

I just checked the MRP, and it does look to be an issue with culling specifically with the repeat times setting, though weirdly I don't recall it doing this when it was originally merged, so I'll have to see if something has changed since then. On the bright side, all the cases in the MRP seem to be scenarios that wouldn't be used in an actual parallax scene, but I'd still like to investigate and get it fixed.

Edit: note for myself for later. It definitely is something between repeat times and the child canvas items being scaled up/down.

@markdibarry
Copy link
Contributor

Figured it out! It was totally a mistake on my part. I forgot to take scale into consideration with the positioning when increasing the repeat times only with the culling. Fun fact: you can see the canvas cull boundaries if you put your canvas item in a CanvasGroup and add a shader to make all transparent areas a different color! The bounds were positioned wrong so the items would seemingly disappear at random zoom levels or scrolling. You can see it in play here:

2024-06-04.11-35-55.mp4

"Goodbye, my icon people need me..."

Here it is after the fix:

2024-06-04.11-29-02.mp4

I'll make a PR today. Thanks again for the catch!

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

Successfully merging a pull request may close this issue.

4 participants