From f8de29198782653134bd2296e88c05abac4c25cd Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Wed, 13 Nov 2024 00:12:27 -0500 Subject: [PATCH 1/2] add docs to view uniform frustum field --- 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 572a1db7b81cf..58e2971064749 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 c67f382c23b6e..d1a48cd153481 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, From 8c5977d39b6517924bb2d119d3de4da2e82745c7 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Wed, 13 Nov 2024 00:21:29 -0500 Subject: [PATCH 2/2] A --- crates/bevy_render/src/view/mod.rs | 2 +- crates/bevy_render/src/view/view.wgsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 58e2971064749..f3a62912925d2 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -431,7 +431,7 @@ pub struct ViewUniform { 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.` + /// 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 d1a48cd153481..46ba189dad9e7 100644 --- a/crates/bevy_render/src/view/view.wgsl +++ b/crates/bevy_render/src/view/view.wgsl @@ -27,7 +27,7 @@ struct View { 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.` + // A half space contains `p` if `normal.dot(p) + distance > 0.` frustum: array, 6>, color_grading: ColorGrading, mip_bias: f32,