Skip to main content

DebugView

Enum DebugView 

Source
pub enum DebugView {
    Shaded,
    Heatmap,
    LodTint,
    Normals,
    AmbientOcclusion,
    Motion,
    BentNormal,
    ShadowAtlas,
    Cascades,
}
Expand description

Which picture the colour pass draws instead of the shaded one.

The engine’s debug views, as one value rather than as independent booleans, because they are not independent: every one of them rides in a single lane of the frame’s uniform block and the shaders test the thresholds outermost first, so a renderer with two of them set draws exactly one. ForwardRenderer::debug_view is where that order lives, and this is what it answers with — so a menu row, a debug panel and the picture cannot disagree about which view is on.

The declaration order is not the precedence — each view was appended as it arrived, and ForwardRenderer::debug_view is the one place the order is decided. The sentinels in FrameUniforms ascend with it, though: see its HEATMAP_VIEW_ON, and the shaders test the outermost threshold first.

Variants§

§

Shaded

The lit picture. What every frame draws unless a caller asked otherwise.

§

Heatmap

Each cluster shaded by the projected screen-space error the LOD selection judged it on — ForwardRenderer::set_heatmap.

§

LodTint

Each cluster tinted by the DAG level it was decimated to — ForwardRenderer::set_lod_view.

§

Normals

World-space surface normals — ForwardRenderer::set_normals_view.

§

AmbientOcclusion

The ambient-occlusion channel alone, as grey — ForwardRenderer::set_occlusion_view.

§

Motion

The motion vector each fragment wrote, stretched and centred on grey — ForwardRenderer::set_motion_view.

§

BentNormal

The bent direction the occlusion channel carries beside its scalar, as n * 0.5 + 0.5 — ForwardRenderer::set_bent_normal_view. Wins over every other view.

§

ShadowAtlas

The sun’s cascades and the lit tiles beside them — the D32Float shadow atlas itself, letterboxed over the finished frame with a border round every occupied slot — ForwardRenderer::set_atlas_view.

The one view that is a pass rather than a branch in mesh.slang, and therefore the one whose lane is the off sentinel: the colour pass draws the shaded picture exactly as it always did and crate::atlas_view replaces it afterwards. That module’s header is where the placement is argued.

It resolves below every view above and above Self::Cascades — see ForwardRenderer::debug_view.

§

Cascades

The shaded picture tinted by the cascade each sun-lit fragment’s shadow was sampled from, with the cross-fade band drawn as the blend of the two — ForwardRenderer::set_cascade_view.

Loses to every other view, and it is the only one that does. The views above draw something instead of the shaded picture; this one draws the shaded picture and multiplies it, so there is nothing left for it to modulate as soon as one of them is on. See ForwardRenderer::debug_view.

Implementations§

Source§

impl DebugView

Source

pub const fn label(self) -> &'static str

What a panel row or a summary line calls it.

Trait Implementations§

Source§

impl Clone for DebugView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DebugView

Source§

impl Debug for DebugView

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DebugView

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for DebugView

Source§

impl PartialEq for DebugView

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DebugView

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.