From c6fe275b21919aadc08c217a4fc36aea5668ab98 Mon Sep 17 00:00:00 2001 From: atlv Date: Sun, 17 Nov 2024 19:33:24 -0500 Subject: [PATCH] add docs to view uniform frustum field (#16369) just some docs to save future me some clicking around --- crates/bevy_render/src/view/mod.rs | 3 +++ crates/bevy_render/src/view/view.wgsl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 572a1db7b8..f3a6291292 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -429,6 +429,9 @@ pub struct ViewUniform { pub exposure: f32, // viewport(x_origin, y_origin, width, height) pub viewport: Vec4, + /// 6 world-space half spaces (normal: vec3, distance: f32) ordered left, right, top, bottom, near, far. + /// The normal vectors point towards the interior of the frustum. + /// A half space contains `p` if `normal.dot(p) + distance > 0.` pub frustum: [Vec4; 6], pub color_grading: ColorGradingUniform, pub mip_bias: f32, diff --git a/crates/bevy_render/src/view/view.wgsl b/crates/bevy_render/src/view/view.wgsl index c67f382c23..46ba189dad 100644 --- a/crates/bevy_render/src/view/view.wgsl +++ b/crates/bevy_render/src/view/view.wgsl @@ -25,6 +25,9 @@ struct View { exposure: f32, // viewport(x_origin, y_origin, width, height) viewport: vec4, + // 6 world-space half spaces (normal: vec3, distance: f32) ordered left, right, top, bottom, near, far. + // The normal vectors point towards the interior of the frustum. + // A half space contains `p` if `normal.dot(p) + distance > 0.` frustum: array, 6>, color_grading: ColorGrading, mip_bias: f32,