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 more