pub struct GBufferDebugView {Show 13 fields
pub active_channel: GBufferDebugChannel,
pub enabled: bool,
pub exposure: f32,
pub depth_near: f32,
pub depth_far: f32,
pub grid_cols: u32,
pub grid_rows: u32,
pub overlay_opacity: f32,
pub material_id_palette: Vec<[f32; 3]>,
pub zoom: f32,
pub pan: [f32; 2],
pub show_pixel_values: bool,
pub cursor_pos: [u32; 2],
}Expand description
Debug view configuration and state for visualizing G-Buffer contents.
Fields§
§active_channel: GBufferDebugChannelWhich channel is currently being displayed.
enabled: boolWhether the debug view is enabled.
exposure: f32Exposure multiplier for HDR channels (emission, position range).
depth_near: f32Depth visualization near plane override (0 = auto).
depth_far: f32Depth visualization far plane override (0 = auto).
grid_cols: u32Grid layout dimensions when showing all channels.
grid_rows: u32§overlay_opacity: f32Overlay opacity when compositing debug view over the scene (0..1).
material_id_palette: Vec<[f32; 3]>False color palette for material ID visualization.
zoom: f32Zoom level for the debug view (1.0 = fit to screen).
pan: [f32; 2]Pan offset in normalized coordinates.
show_pixel_values: boolWhether to show numeric values at cursor position.
cursor_pos: [u32; 2]Cursor position for pixel value readback.
Implementations§
Source§impl GBufferDebugView
impl GBufferDebugView
pub fn new() -> Self
Sourcepub fn cycle_next(&mut self)
pub fn cycle_next(&mut self)
Cycle to the next channel.
Sourcepub fn cycle_prev(&mut self)
pub fn cycle_prev(&mut self)
Cycle to the previous channel.
Sourcepub fn set_channel(&mut self, channel: GBufferDebugChannel)
pub fn set_channel(&mut self, channel: GBufferDebugChannel)
Set the debug channel directly.
Sourcepub fn adjust_exposure(&mut self, delta: f32)
pub fn adjust_exposure(&mut self, delta: f32)
Adjust exposure for HDR debug visualization.
Sourcepub fn reset_view(&mut self)
pub fn reset_view(&mut self)
Reset zoom and pan to defaults.
Sourcepub fn grid_cell_viewport(
&self,
channel_index: u32,
full_viewport: &Viewport,
) -> Viewport
pub fn grid_cell_viewport( &self, channel_index: u32, full_viewport: &Viewport, ) -> Viewport
Compute the viewport region for a specific channel in the “All” grid view.
Sourcepub fn linearize_depth(&self, raw_depth: f32) -> f32
pub fn linearize_depth(&self, raw_depth: f32) -> f32
Map a raw depth value to a visualizable [0, 1] range using the configured near/far.
Sourcepub fn visualize_normal(n: [f32; 3]) -> [f32; 3]
pub fn visualize_normal(n: [f32; 3]) -> [f32; 3]
Convert a normal from [-1,1] to [0,1] for visualization.
Sourcepub fn material_id_color(&self, id: u8) -> [f32; 3]
pub fn material_id_color(&self, id: u8) -> [f32; 3]
Get the false color for a material ID.
Sourcepub fn generate_debug_shader(&self) -> String
pub fn generate_debug_shader(&self) -> String
Generate a GLSL snippet for the currently selected debug visualization.
Trait Implementations§
Source§impl Clone for GBufferDebugView
impl Clone for GBufferDebugView
Source§fn clone(&self) -> GBufferDebugView
fn clone(&self) -> GBufferDebugView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GBufferDebugView
impl Debug for GBufferDebugView
Auto Trait Implementations§
impl Freeze for GBufferDebugView
impl RefUnwindSafe for GBufferDebugView
impl Send for GBufferDebugView
impl Sync for GBufferDebugView
impl Unpin for GBufferDebugView
impl UnsafeUnpin for GBufferDebugView
impl UnwindSafe for GBufferDebugView
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.