Cycles: Improved robustness of hair motion blur.
Needs ReviewPublic

Authored by Stefan Werner (swerner) on Fri, Sep 14, 4:20 PM.

Details

Reviewers
None
Group Reviewers
Cycles
Summary

In some instances, the number of control vertices of a hair could change mid-frame.
Cycles would then be unable to calculate proper motion blur for those hairs. This adds
interpolated CVs to fill in for the missing data. While this will not necessarily result in
a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it.

Diff Detail

Repository
rB Blender
Branch
motion_curve_fix
Build Status
Buildable 2066
Build 2066: arc lint + arc unit

Unfortunately, I have no .blend file to demonstrate this bug, at least not one that I could legally share.

It did arise though in the production of Next Gen that we'd see individual frames in which hair motion was absent. Since the camera and the character were both moving fast, this led to the hair showing up as long streaks as the camera shot past it. It turns out that Blender's hair simulation does not guarantee that a given hair has a constant number of CVs through time, it can actually change. Since Cycles' motion blur requires a constant number of CVs for the duration of a frame, this led to motion blur dropping out in rare cases.

This patch then synthesises a new hair curve that matches the CVs count of the original (center frame) curve.

A future improvement would be to use spline interpolation instead of linear interpolation for the new hair curves to better approximate its original shape.

  • Fixed whitespace.