mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Optimize glow and tonemap gather step in the mobile renderer
Mobile devices are typically bandwidth bound which means we need to do as few texture samples as possible. They typically use TBDR GPUs which means that all rendering takes place on special optimized tiles. As a side effect, reading back memory from tile to VRAM is really slow, especially on Mali devices. This commit uses a technique where you do a small blur while downsampling, and then another small blur while upsampling to get really high quality glow. While this doesn't reduce the renderpass count very much, it does reduce the texture read bandwidth by almost 10 times. Overall glow was more texture-read bound than memory write, bound, so this was a huge win. A side effect of this new technique is that we can gather the glow as we upsample instead of gathering the glow in the final tonemap pass. Doing so allows us to significantly reduce the cost of the tonemap pass as well.
This commit is contained in:
parent
084d5d407e
commit
2e59cb41f4
22 changed files with 1524 additions and 519 deletions
|
|
@ -1572,7 +1572,7 @@ Environment::Environment() {
|
|||
set_camera_feed_id(bg_camera_feed_id);
|
||||
|
||||
glow_levels.resize(7);
|
||||
glow_levels.write[0] = 1.0;
|
||||
glow_levels.write[0] = 0.0;
|
||||
glow_levels.write[1] = 0.8;
|
||||
glow_levels.write[2] = 0.4;
|
||||
glow_levels.write[3] = 0.1;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ private:
|
|||
float glow_mix = 0.05;
|
||||
float glow_bloom = 0.0;
|
||||
GlowBlendMode glow_blend_mode = GLOW_BLEND_MODE_SCREEN;
|
||||
float glow_hdr_bleed_threshold = 1.0;
|
||||
float glow_hdr_bleed_threshold = 0.0;
|
||||
float glow_hdr_bleed_scale = 2.0;
|
||||
float glow_hdr_luminance_cap = 12.0;
|
||||
float glow_map_strength = 0.8f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue