pub struct CpuCutout {
pub focus_local: [f32; 3],
pub tan_outer: f32,
pub tan_inner: f32,
pub margin: f32,
pub focus_z: i32,
}Expand description
OC.0 — the view cutout as one grid’s render pass consumes it, fully
derived by the facade each frame (stage OC; see
FrameParams::view_cutout in roxlap-render). A cell is hidden
iff ALL of: its CENTRE lies inside the view cone around the
eye→focus axis (the cone tapers across the feather band), its
eye distance is under the nearest character-column point’s minus
margin, and its grid-local z is above the focus
plane (z < focus_z, z-down) — walls between the camera and the
focus cut, the floor in front of the focus stays.
Per-CELL, not per-pixel (the OC.3 visual-pass round-2 redesign): the original rule gated each RAY by a screen-space window, so a cell straddling the window edge rendered for the outside pixels only — sub-cell fragments that read as ragged teeth wherever the boundary crossed a floor or wall at a shallow angle. Classifying whole cells by their centres makes the cut edge cube-granular and spatially coherent, exactly like the CA clip’s edges.
Fields§
§focus_local: [f32; 3]The focus point in this grid’s local frame, voxel units (the same space the ray origin lives in).
tan_outer: f32Tangent of the cone’s OUTER half-angle (nothing is cut outside
it). The facade derives it from the keyhole’s pixel radius and
the frame’s focal length (radius_px / hz), so it still means
“a screen circle of ~radius_px around the projected focus”.
tan_inner: f32Tangent of the full-reveal INNER half-angle
((radius − feather)/hz): between the two the reveal distance
tapers linearly to zero, closing the keyhole into a smooth
funnel. == tan_outer gives a hard edge.
margin: f32How far short of the character COLUMN the reveal stops, in this
grid’s voxel units (world units /vws). The reveal surface
hugs the column — the vertical segment at the focus xy between
the focus plane (Self::focus_z, the feet) and its mirror
above the focus (the head): a cell is hidden while its eye
distance is under the eye distance of the NEAREST column point
at the cell’s own height, minus this margin. A fixed
eye-distance sphere through the focus (the previous rule) kept
waist-down stumps of any obstacle the character stood right
behind — below-chest cells in front sit FARTHER from an
elevated eye than the chest itself.
focus_z: i32Grid-local absolute voxel z of the focus plane (mip-0,
z-down, spanning stacked chz chunks — the same space as
Self::z_clip); cells with z < focus_z
qualify for hiding. At mip N the compare uses focus_z >> mip
(arithmetic shift = floor), the CA.1 formula. This is the
FIRST, cheap gate in the hit branch: i32::MIN-like sentinels
keep the disabled cost at one never-true compare.
Trait Implementations§
impl Copy for CpuCutout
impl StructuralPartialEq for CpuCutout
Auto Trait Implementations§
impl Freeze for CpuCutout
impl RefUnwindSafe for CpuCutout
impl Send for CpuCutout
impl Sync for CpuCutout
impl Unpin for CpuCutout
impl UnsafeUnpin for CpuCutout
impl UnwindSafe for CpuCutout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more