bevyengine / bevyengine/bevy

Bloom causes massive performance hit (>50% framerate reduction)

Open
#13,109 16 comments 1 reaction 0 assignees View on GitHub
A-Rendering C-Performance S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

OS = "Win11"

Bevy version = "0.14.0-dev" && "0.13.2"

AdapterInfo { name: "AMD Radeon RX 7700S", vendor: 4098, device: 29824, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "24.3.1 (LLPC)", backend: Vulkan }

[profile.dev.package."*"]
opt-level = 3

[profile.dev]
opt-level = 3

[profile.release]
lto = true
opt-level = 3
codegen-units = 1
incremental = false
debug = false

## What you did

Enabled bloom

![image](https://github.com/bevyengine/bevy/assets/128448098/486237a3-338a-45bc-9a7b-06203ebe3d68)

## What went wrong

Enabling bloom gives a massive hit to performance in both debug and release. In these examples I'll use debug (as nothing changed between them in RenderDoc except overall framerate).

In other game engines I've never personally experienced a hit this large from bloom. This was tested with both a personal example and the bloom_2d example in 0.14, as well as a simple bloom setup in 0.13.2. I tested bloom in Unity with a similar scene for a quick comparison and the performance impact in Unity is around 10% give or take - which iirc from using other engines is about the standard hit.

In Bevy issues I did a quick search for issues related to bloom and didn't see any mention of a performance profile on the bloom pass. With that in mind I figured opening up an issue would be best. If I missed an open issue relating to this please point me in the right direction - as I plan to explore the bloom passes code more in the future.

Bloom off:

![image](https://github.com/bevyengine/bevy/assets/128448098/7c8fbd44-ad3f-4a82-8b90-80b39919914f)

Bloom on:

![image](https://github.com/bevyengine/bevy/assets/128448098/7369af4b-2e00-4652-a6c6-bc6d0903e050)

## RenderDoc info

Full time:

![image](https://github.com/bevyengine/bevy/assets/128448098/049143ad-506d-40b0-8fd7-cc3a87424796)

Bloom pass:

![image](https://github.com/bevyengine/bevy/assets/128448098/d48646b4-d222-4b6f-b04b-2af106c10e5e)

![image](https://github.com/bevyengine/bevy/assets/128448098/964d68a8-998a-4798-83f7-5daccd6f9ca8)

![image](https://github.com/bevyengine/bevy/assets/128448098/57522e02-974b-43ad-bc98-5b7250018671)

![image](https://github.com/bevyengine/bevy/assets/128448098/e1bdaee9-0a47-440e-acd1-147dc0d0e52a)

## Conclusion:

Based on this information from RenderDoc - it would seem that the bloom pass is heavier on rendering than everything else combined. Bloom takes up more than 50% of the render time when enabled.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the bloom_2d example and compare bloom-off and bloom-on captures in RenderDoc. Read the bloom passes code and use the reported pass timings to identify why bloom consumes over half of render time. Done means documenting and validating a meaningful reduction in bloom's performance cost.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.