diff --git a/crates/bevy_anti_aliasing/src/dlss/mod.rs b/crates/bevy_anti_aliasing/src/dlss/mod.rs index dae40e1082..89c56bf771 100644 --- a/crates/bevy_anti_aliasing/src/dlss/mod.rs +++ b/crates/bevy_anti_aliasing/src/dlss/mod.rs @@ -1,3 +1,15 @@ +//! NVIDIA Deep Learning Super Sampling. +//! +//! See https://github.com/JMS55/dlss_wgpu for licensing requirements and setup instructions. +//! +//! # Usage +//! 1. Enable Bevy's `dlss` feature +//! 2. During app setup, insert the `DlssProjectId` resource before `DefaultPlugins` +//! 3. Check for the presence of `Option>` at runtime to see if DLSS is supported on the current machine +//! 4. Add the `Dlss` component to your camera entity, optionally setting a specific `DlssPerfQualityMode` (defaults to `Auto`) +//! 5. Optionally add sharpening via `ContrastAdaptiveSharpening` +//! 6. Custom rendering code, including third party crates, should account for the optional `MainPassResolutionOverride` to work with DLSS (see the `custom_render_phase` example) + mod extract; mod node; mod prepare; @@ -80,6 +92,7 @@ impl Plugin for DlssPlugin { } } +/// Camera component to enable DLSS. #[derive(Component, Reflect, Clone, Default)] #[reflect(Component, Default)] #[require(TemporalJitter, MipBias, DepthPrepass, MotionVectorPrepass, Hdr)] diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 29bb44a298..9d6c07432e 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -673,10 +673,15 @@ pub fn get_mali_driver_version(adapter: &RenderAdapter) -> Option { None } +/// Application-specific ID for DLSS. +/// +/// See the DLSS programming guide for more info. #[cfg(feature = "dlss")] #[derive(Resource)] pub struct DlssProjectId(pub bevy_asset::uuid::Uuid); +/// When DLSS is supported by the current system, this resource will exist in the main world. +/// Otherwise this resource will be absent. #[cfg(feature = "dlss")] #[derive(Resource, Clone, Copy)] pub struct DlssSupported;