From a88b9fc6a9d6ddb7a11d0d59f1f3c9d6343d18fc Mon Sep 17 00:00:00 2001 From: Joseph <21144246+JoJoJet@users.noreply.github.com> Date: Sat, 29 Jul 2023 15:22:49 -0700 Subject: [PATCH] Document `ClearColorConfig` (#9288) # Objective Document the `ClearColorConfig` enum, and describe the behavior of its variants. --- crates/bevy_core_pipeline/src/clear_color.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_core_pipeline/src/clear_color.rs b/crates/bevy_core_pipeline/src/clear_color.rs index 50861e1bebb1f..0461b6c2c714e 100644 --- a/crates/bevy_core_pipeline/src/clear_color.rs +++ b/crates/bevy_core_pipeline/src/clear_color.rs @@ -4,12 +4,18 @@ use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; use bevy_render::{color::Color, extract_resource::ExtractResource}; use serde::{Deserialize, Serialize}; +/// For a camera, specifies the color used to clear the viewport before rendering. #[derive(Reflect, Serialize, Deserialize, Clone, Debug, Default)] #[reflect(Serialize, Deserialize)] pub enum ClearColorConfig { + /// The clear color is taken from the world's [`ClearColor`] resource. #[default] Default, + /// The given clear color is used, overriding the [`ClearColor`] resource defined in the world. Custom(Color), + /// No clear color is used: the camera will simply draw on top of anything already in the viewport. + /// + /// This can be useful when multiple cameras are rendering to the same viewport. None, }