Early-exit bloom node if intensity == 0.0 (#12113)
# Objective - The bloom effect is currently somewhat costly (in terms of GPU time used), due to using fragment shaders for down- and upscaling (compute shaders generally perform better for such tasks). - Additionally, one might have a `BloomSettings` on a camera whose `intensity` is only occasionally set to a non-zero value (eg. in outside areas or areas with bright lighting). Currently, the cost of the bloom shader is always incurred as long as the `BloomSettings` exists. ## Solution - Bail out of the bloom render node when `intensity == 0.0`, making the effect free as long as it is turned all the way down.
This commit is contained in:
parent
bb00d9fc3c
commit
e5994a4e55
@ -129,6 +129,10 @@ impl ViewNode for BloomNode {
|
|||||||
): QueryItem<Self::ViewQuery>,
|
): QueryItem<Self::ViewQuery>,
|
||||||
world: &World,
|
world: &World,
|
||||||
) -> Result<(), NodeRunError> {
|
) -> Result<(), NodeRunError> {
|
||||||
|
if bloom_settings.intensity == 0.0 {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let downsampling_pipeline_res = world.resource::<BloomDownsamplingPipeline>();
|
let downsampling_pipeline_res = world.resource::<BloomDownsamplingPipeline>();
|
||||||
let pipeline_cache = world.resource::<PipelineCache>();
|
let pipeline_cache = world.resource::<PipelineCache>();
|
||||||
let uniforms = world.resource::<ComponentUniforms<BloomUniforms>>();
|
let uniforms = world.resource::<ComponentUniforms<BloomUniforms>>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user