pub struct LightingPass {Show 16 fields
pub enabled: bool,
pub shader_handle: u64,
pub lights: Vec<LightType>,
pub max_lights_per_pixel: u32,
pub use_light_volumes: bool,
pub time_us: u64,
pub lights_evaluated: u32,
pub ambient_color: [f32; 3],
pub ambient_intensity: f32,
pub ssao_enabled: bool,
pub ssao_radius: f32,
pub ssao_bias: f32,
pub ssao_kernel_size: u32,
pub environment_map: u64,
pub ibl_enabled: bool,
pub ibl_intensity: f32,
}Expand description
The lighting pass reads from the G-Buffer and evaluates all lights to produce an HDR color result.
Fields§
§enabled: boolWhether this pass is enabled.
shader_handle: u64Shader program handle.
lights: Vec<LightType>All lights in the scene.
max_lights_per_pixel: u32Maximum number of lights to evaluate per pixel.
use_light_volumes: boolWhether to use light volumes (render spheres/cones for point/spot lights).
time_us: u64Time taken (microseconds).
lights_evaluated: u32Number of lights evaluated this frame.
ambient_color: [f32; 3]Ambient color (added to all pixels).
ambient_intensity: f32Ambient intensity.
ssao_enabled: boolWhether to apply SSAO (screen-space ambient occlusion).
ssao_radius: f32SSAO radius.
ssao_bias: f32SSAO bias.
ssao_kernel_size: u32SSAO kernel size.
environment_map: u64Environment map handle (for IBL).
ibl_enabled: boolWhether image-based lighting is enabled.
ibl_intensity: f32IBL intensity multiplier.
Implementations§
Source§impl LightingPass
impl LightingPass
pub fn new() -> Self
Sourcepub fn clear_lights(&mut self)
pub fn clear_lights(&mut self)
Remove all lights.
Sourcepub fn execute(
&mut self,
gbuffer: &GBuffer,
hdr_fb: &HdrFramebuffer,
view_matrix: &Mat4,
projection_matrix: &Mat4,
camera_pos: [f32; 3],
)
pub fn execute( &mut self, gbuffer: &GBuffer, hdr_fb: &HdrFramebuffer, view_matrix: &Mat4, projection_matrix: &Mat4, camera_pos: [f32; 3], )
Execute the lighting pass.
Sourcepub fn evaluate_pbr(
&self,
position: [f32; 3],
normal: [f32; 3],
albedo: [f32; 3],
roughness: f32,
metallic: f32,
camera_pos: [f32; 3],
) -> [f32; 3]
pub fn evaluate_pbr( &self, position: [f32; 3], normal: [f32; 3], albedo: [f32; 3], roughness: f32, metallic: f32, camera_pos: [f32; 3], ) -> [f32; 3]
Evaluate PBR lighting at a single point (for CPU-side validation).
Sourcepub fn fragment_shader() -> &'static str
pub fn fragment_shader() -> &'static str
Generate the lighting pass fragment shader.
Trait Implementations§
Source§impl Debug for LightingPass
impl Debug for LightingPass
Auto Trait Implementations§
impl Freeze for LightingPass
impl RefUnwindSafe for LightingPass
impl Send for LightingPass
impl Sync for LightingPass
impl Unpin for LightingPass
impl UnsafeUnpin for LightingPass
impl UnwindSafe for LightingPass
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> 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.