Skip to content

Commit

Permalink
Remove duplicated fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Cecile committed May 29, 2024
1 parent c996067 commit aeed2c5
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions crates/bevy_core_pipeline/src/auto_exposure/auto_exposure.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,6 @@ fn compute_average(@builtin(local_invocation_index) local_index: u32) {
* compensation_curve.compensation_range
+ compensation_curve.min_compensation
- avg_lum;
// Target exposure controls how much we should brighten or darken the scene.
// Higher values will brighten the scene, while lower values will darken it.
//
// If all values are below the threshold,
// we should set it to the maximum value.
// Since no pixels are overexposed, we should correct the exposure as much as possible.
var target_exposure = compensation_curve.min_compensation + compensation_curve.compensation_range;

if count > 0u {
// The average luminance of the included histogram samples.
let avg_lum = sum / (f32(count) * 63.0)
* settings.log_lum_range
+ settings.min_log_lum;

// The position in the compensation curve texture to sample for avg_lum.
let u = (avg_lum - compensation_curve.min_log_lum) * compensation_curve.inv_log_lum_range;

// The target exposure is the negative of the average log luminance.
// The compensation value is added to the target exposure to adjust the exposure for
// artistic purposes.
target_exposure = textureLoad(tex_compensation, i32(saturate(u) * 255.0), 0).r
* compensation_curve.compensation_range
+ compensation_curve.min_compensation
- avg_lum;
}

// Smoothly adjust the `exposure` towards the `target_exposure`
let delta = target_exposure - exposure;
Expand Down

0 comments on commit aeed2c5

Please sign in to comment.