Struct oidn::RayTracing
source · pub struct RayTracing<'a> { /* private fields */ }
Expand description
A generic ray tracing denoising filter for denoising images produces with Monte Carlo ray tracing methods such as path tracing.
Implementations§
source§impl<'a> RayTracing<'a>
impl<'a> RayTracing<'a>
pub fn new(device: &'a Device) -> RayTracing<'a>
sourcepub fn filter_quality(&mut self, quality: Quality) -> &mut RayTracing<'a>
pub fn filter_quality(&mut self, quality: Quality) -> &mut RayTracing<'a>
Sets the quality of the output, the default is high.
Balanced lowers the precision, if possible, however some devices will not support this and so the result (and performance) will stay the same as high. Balanced is recommended for realtime usages.
sourcepub fn albedo_normal(
&mut self,
albedo: &[f32],
normal: &[f32]
) -> &mut RayTracing<'a>
pub fn albedo_normal( &mut self, albedo: &[f32], normal: &[f32] ) -> &mut RayTracing<'a>
Set input auxiliary images containing the albedo and normals.
Albedo must have three channels per pixel with values in [0, 1].
Normal must contain the shading normal as three channels per pixel
world-space or view-space vectors with arbitrary length, values
in [-1, 1]
.
sourcepub fn albedo(&mut self, albedo: &[f32]) -> &mut RayTracing<'a>
pub fn albedo(&mut self, albedo: &[f32]) -> &mut RayTracing<'a>
Set an input auxiliary image containing the albedo per pixel (three
channels, values in [0, 1]
).
sourcepub fn hdr(&mut self, hdr: bool) -> &mut RayTracing<'a>
pub fn hdr(&mut self, hdr: bool) -> &mut RayTracing<'a>
Set whether the color is HDR.
pub fn hdr_scale(&mut self, hdr_scale: f32) -> &mut RayTracing<'a>
sourcepub fn input_scale(&mut self, input_scale: f32) -> &mut RayTracing<'a>
pub fn input_scale(&mut self, input_scale: f32) -> &mut RayTracing<'a>
Sets a scale to apply to input values before filtering, without scaling the output too.
This can be used to map color or auxiliary feature values to the expected range. E.g. for mapping HDR values to physical units (which affects the quality of the output but not the range of the output values). If not set, the scale is computed implicitly for HDR images or set to 1 otherwise
sourcepub fn srgb(&mut self, srgb: bool) -> &mut RayTracing<'a>
pub fn srgb(&mut self, srgb: bool) -> &mut RayTracing<'a>
Set whether the color is encoded with the sRGB (or 2.2 gamma) curve (LDR only) or is linear.
The output will be encoded with the same curve.
sourcepub fn clean_aux(&mut self, clean_aux: bool) -> &mut RayTracing<'a>
pub fn clean_aux(&mut self, clean_aux: bool) -> &mut RayTracing<'a>
Set whether the auxiliary feature (albedo, normal) images are noise-free.
Recommended for highest quality but should not be enabled for noisy auxiliary images to avoid residual noise.