From 8d39b8a76012767415f95bbd9da63cb07ec87af3 Mon Sep 17 00:00:00 2001 From: Marco Buono Date: Wed, 26 Apr 2023 00:31:55 -0300 Subject: [PATCH] Enable TAA by default in example --- examples/3d/transmission.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/3d/transmission.rs b/examples/3d/transmission.rs index 51a8050bb7..58dd85c5e6 100644 --- a/examples/3d/transmission.rs +++ b/examples/3d/transmission.rs @@ -18,7 +18,12 @@ use std::f32::consts::PI; use bevy::{ - core_pipeline::{bloom::BloomSettings, prepass::DepthPrepass, tonemapping::Tonemapping}, + core_pipeline::{ + bloom::BloomSettings, + experimental::taa::{TemporalAntiAliasBundle, TemporalAntiAliasPlugin}, + prepass::DepthPrepass, + tonemapping::Tonemapping, + }, pbr::{NotShadowCaster, NotTransmittedShadowReceiver, PointLightShadowMap}, prelude::*, render::view::ColorGrading, @@ -34,15 +39,13 @@ fn main() { brightness: 0.0, ..default() }) + // *Note:* TAA is not _required_ for specular transmission, but + // it _greatly enhances_ the look of the resulting blur effects + .insert_resource(Msaa::Off) + .add_plugin(TemporalAntiAliasPlugin) .add_systems(Startup, setup) .add_systems(Update, (example_control_system, flicker_system)); - // Unfortunately, MSAA and HDR are not supported simultaneously under WebGL. - // Since this example uses HDR, we must disable MSAA for WASM builds, at least - // until WebGPU is ready and no longer behind a feature flag in Web browsers. - #[cfg(target_arch = "wasm32")] - app.insert_resource(Msaa::Off); - app.run(); } @@ -344,7 +347,7 @@ fn setup( tonemapping: Tonemapping::TonyMcMapface, ..default() }, - DepthPrepass, + TemporalAntiAliasBundle::default(), EnvironmentMapLight { diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"), specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"),