Auto Exposure for Bevy HDR

A Bevy plugin for auto exposure.
Features:
- Setting min/max exposure values for the camera;
- Metering mask to give more weight to certain parts of the image;
- Smooth exposure transition, with speparate settings for brightening and darkening;
- Exposure compensation curves, for example to make dark scenes look actually dark.
Usage
Setting up auto exposure is easy:
use bevy::prelude::*;
use bevy_mod_auto_exposure::{AutoExposurePlugin, AutoExposure};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(AutoExposurePlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Camera3dBundle {
camera: Camera {
hdr: true,
..default()
},
..default()
},
AutoExposure {
min: -16.0,
max: 16.0,
compensation_curve: vec![vec2(-16.0, -4.0), vec2(0.0, 0.0)],
..default()
},
));
}
Bevy Version Support
I intend to track the latest releases of Bevy.
Examples
cargo run --example auto_exposure
Licensing
This project is dual-licensed under either
- MIT License: Available online
- Apache License, Version 2.0: Available online
at your option.