Skip to main content

Module sampling

Module sampling 

Source
Expand description

Integer-tick centered shutter sampling and linear accumulation.

use motion_core::prelude::*;
let cache = SceneCache::default();
let context = SceneContext::new(
    Time::from_frame(1, fps!(30)),
    fps!(30),
    Size::new(8.0, 4.0),
    &cache,
);
let node = context.motion_blur(2.milliseconds(), 2, |sample| {
    Node::from(Rect::new(sample.seconds() * 4.0, 0.0, 4.0, 4.0).fill(Color::WHITE))
});
node.compile(
    context.size(),
    PixelSize::new(8, 4),
    ValidationLimits::default(),
)?;

Structs§

MotionBlur
Global shutter configuration; with exact centered tick offsets.
ShutterSampling
Explicit deterministic jitter, exposure weights and adaptive screen-space sampling.

Enums§

ShutterCurve
Normalized temporal exposure profile.

Functions§

sample_offsets
Centered integer midpoint offsets, nearest-tick ties away from zero.