Skip to content

Poor performance rendering points #18792

@jerome-caucat

Description

@jerome-caucat

Bevy version

0.15.0

Relevant system information

  • Machine: laptop XPS 13 9310
  • OS: Ubuntu 24.04.2 LTS
`AdapterInfo { name: "Intel(R) Iris(R) Xe Graphics (TGL GT2)", vendor: 32902, device: 39497, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 25.0~git2504031308.ff386e~oibaf~n (git-ff386eb 2025-04-03 noble-oibaf-ppa)", backend: Vulkan }`

What you did

  • I am drawing around 300 meshes, each containing between 1 and 200k points, for a total of 4e6 points.
  • Each mesh only contain vertex positions, no indices, no normals, with PrimitiveTopology::PointList.
  • All the meshes are using the same StandardMaterial and have the NotShadowCaster component:
    StandardMaterial {
        base_color: Color::WHITE,
        unlit: true,
        depth_bias: 0.0,
        alpha_mode: AlphaMode::Opaque,
        fog_enabled: false,
        ..Default::default()
    }
  • Adding the NotShadowCaster component was necessary to prevent the shadow passes on the meshes, even though the material is unlit.
  • I also tried with a very minimal custom shader, without much improvements.
  • I also disabled the vsync with bevy::window::PresentMode::Immediate.

What went wrong

  • The GPU Render 3D engine is used at 100%, while the CPU and RAM are barely used.
  • The FPS is low: 15 to 20.
  • Adding more points slow the app even more, until complete freeze of the app and my displays.

Additional information

  • A single draw call for 100k points is listed in RenderDoc with a duration of 1ms.
  • The main_opaque_pass_3d is listed in RenderDoc with a duration of 25ms for 4e6 points, over 287 vkCmdDraw.
  • The main_opaque_pass_3d, and the duration of the draw calls, seems to be the bottleneck.
  • There is not much difference between the dev and release builds.
  • I noticed in tracy and RenderDoc that the app still spend some time related to lighting, shadows and fog, but this may be negligible.
  • I cannot merge all the points in the same mesh, because the application needs to remove and add batches of points.
RenderDoc Tracy Frame Tracy Stats
Image Image Image

Considering the amount of points, the framerate seems quite low, the duration of the opaque rendering pass seems excessive. We have another application (not using bevy) that is able to display over 1e8 points without trouble on the same machine.

  • Do you have any tips to improve the speed of my application?
  • Or to help me debug the problem?
  • Do you think drawing triangles instead of points could help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-PerformanceA change motivated by improving speed, memory usage or compile timesS-Needs-HelpThe author needs help finishing this PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions