A film grain post process shader implementation for the Bevy game engine. It can be used with a single camera or multiple. It's tested to work on desktop and the web with WebGL 2. WebGPU on the web should work but I haven't tested it yet.
Expect changes in the future as there are missing features such as changing the size of the noise and animating the noise over time.
use bevy::prelude::*;
use bevy_mod_film_grain::{FilmGrainPlugin, FilmGrainSettings};
fn main() {
App::new()
.add_plugins((DefaultPlugins, FilmGrainPlugin))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Camera3dBundle::default(),
// Adding this component enables the effect for this camera only.
FilmGrainSettings::from_strength(0.2),
));
}If your camera has hdr enabled, you will need to enable the hdr feature on this crate. Eventually I'll figure out specialization so this isn't needed.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.