From 0dadf4e48dd345152ad923212729a5caf20efe32 Mon Sep 17 00:00:00 2001 From: Marco Buono Date: Sun, 16 Apr 2023 18:36:41 -0300 Subject: [PATCH] Improve documentation for `Camera3d::transmissive_steps` --- crates/bevy_core_pipeline/src/core_3d/camera_3d.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs b/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs index 20474c8e1d..6bba2d5cfa 100644 --- a/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs +++ b/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs @@ -20,14 +20,21 @@ use serde::{Deserialize, Serialize}; #[reflect(Component)] pub struct Camera3d { /// The clear color operation to perform for the main 3d pass. + /// + /// **Note:** When [`Camera3d::transmissive_steps`] > `0`, using a clear color + /// with an alpha value lower than `1.0` will allow the environment map light + /// texture to also be refracted “behind” the screen-space refracted background. pub clear_color: ClearColorConfig, /// The depth clear operation to perform for the main 3d pass. pub depth_load_op: Camera3dDepthLoadOp, - /// How many individual steps should be performed in the transmissive 3d pass + /// How many individual steps should be performed in the transmissive 3d pass. /// /// Roughly corresponds to how many “layers of transparency” are rendered for /// transmissive objects. Each step requires making one additional texture copy, - /// so it's recommended to keep this number to a resonably low value. + /// so it's recommended to keep this number to a resonably low value. Defaults to `1`. + /// + /// Setting this to `0` disables screen-space refraction effect entirely, and falls + /// back to refracting the environment map light's texture. pub transmissive_steps: usize, }