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

Large plane / object causing drop in performance, especially on mobile #11213

Closed
dror-g opened this issue Jan 4, 2024 · 1 comment
Closed
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times C-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@dror-g
Copy link

dror-g commented Jan 4, 2024

Bevy version

0.12 / 0.12.1

Relevant system information

Rust 1.73 and 1.76.0-nightly, build on Ubuntu 22.04, run on Android 9, 12, 14.

Issue exists on:
AdaptAdapterInfo { name: "ANGLE (Qualcomm, Adreno (TM) 618, OpenGL ES 3.2)", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }

AdapterInfo { name: "Mali-G710", vendor: 5045, device: 2824994820, device_type: IntegratedGpu, driver: "Mali-G710", driver_info: "v1.r43p0-01eac0.ff5c643eda65d3f5ba9886fdffb12673", backend: Vulkan }

AdapterInfo { name: "Mali-T720", vendor: 5045, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }

Works better, but still exists on:
AdapterInfo { name: "Intel(R) HD Graphics", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }

AdapterInfo { name: "NVIDIA GeForce GTX 1650 with Max-Q Design", vendor: 4318, device: 8081, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "545.23.08", backend: [Gl | Vulkan]}

What you did

Created a simple scene with a large(-ish) Mesh - Plane or big Box with size 128, to serve as ground, camera looking at objects placed on it.
many_foxes or animated_fox will cause issue as well.

What went wrong

Got terrible performance on mobile devices. i.e:
Samsung Galaxy A71, Qualcomm, Adreno 618:
2 fps on wasm builds, 11 fps on aarch64-linux-android apk.

Google Pixel 7a, Mali-G710:
11 fps on wasm builds, 30 fps on aarch64-linux-android apk.

Laptop with Nvidia / Intel HD was also affected, but to a smaller degree:
100 fps with plain, 300+ fps without it.

This is with a single DirectionalLight with shadows_enabled: false.

Workaround

Problem fixed by hiding Plane using visibility: Visibility::Hidden.
now getting 100+ fps on android, 300+ on laptop.

Also mitigated somewhat by leaving Plane visible, but setting StandardMaterial { unlit: true }.
Gets me 40 fps on android.

Additional information

I couldn't understand why I'm getting such poor performance until accidentally set the camera to negative Y and looked at plane from below and suddenly fps was fine..

I think it is related to issue #6542. very similar. perhaps that issue is not limited to AMD gpus.
Issue #7456 might also be related.

It might be that the problem exists on multiple GPUs, mobile or otherwise, and simply unnoticed on PC/Laptop.

To reproduce attempt to open a wasm or android build with a Plane / Box of size 128 and above and compare fps with it visible and hidden.

Thank you!!

@dror-g dror-g added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 4, 2024
@irate-devil irate-devil added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times C-Regression Functionality that used to work but no longer does. Add a test for this! and removed S-Needs-Triage This issue needs to be labelled labels Jan 9, 2024
@irate-devil
Copy link
Contributor

Duplicate of #10338. Thanks for the extra info :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times C-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

No branches or pull requests

2 participants