You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the templated function HdResampleRawTimeSamples that causes errors in motion blur streaks.
HdResampleRawTimeSamples() is called from HdTimeSampleArray::Resample().
The functions are in pxr\imaging\hd\timeSampleArray.h
The bug is in this line:
// Linear blend of neighboring samples.
float alpha = (us[i]-u) / (us[i]-us[i-1]);
Alpha is used to interpolate between vs[i-1] and vs[i] in the next line:
return HdResampleNeighbors(alpha, vs[i-1], vs[i]);
As u gets closer to us[i], alpha gets closer to zero. As u gets closer to us[i-1], alpha gets closer to 1.
This is backwards. Alpha should get closer to 1 as u gets closer to us[i] and closer to 0 as u gets closer to us[i-1].
The fix is as follows:
// Linear blend of neighboring samples.
float alpha = (u-us[i-1]) / (us[i]-us[i-1]);
Steps to Reproduce
Any use of HdTimeSampleArray::Resample() with a different number of samples than count will show an error in the resulting time sample values.
System Information (OS, Hardware)
Any/NA
Package Versions
USD v21.05
Build Flags
Any/NA
The text was updated successfully, but these errors were encountered:
Thanks for calling this out. We checked in a fix to our internal tree today and it should be on the the github dev branch soon after the USD 21.08 release.
Description of Issue
There is a bug in the templated function HdResampleRawTimeSamples that causes errors in motion blur streaks.
HdResampleRawTimeSamples() is called from HdTimeSampleArray::Resample().
The functions are in pxr\imaging\hd\timeSampleArray.h
The bug is in this line:
// Linear blend of neighboring samples.
float alpha = (us[i]-u) / (us[i]-us[i-1]);
Alpha is used to interpolate between vs[i-1] and vs[i] in the next line:
return HdResampleNeighbors(alpha, vs[i-1], vs[i]);
As u gets closer to us[i], alpha gets closer to zero. As u gets closer to us[i-1], alpha gets closer to 1.
This is backwards. Alpha should get closer to 1 as u gets closer to us[i] and closer to 0 as u gets closer to us[i-1].
The fix is as follows:
// Linear blend of neighboring samples.
float alpha = (u-us[i-1]) / (us[i]-us[i-1]);
Steps to Reproduce
Any use of HdTimeSampleArray::Resample() with a different number of samples than count will show an error in the resulting time sample values.
System Information (OS, Hardware)
Any/NA
Package Versions
USD v21.05
Build Flags
Any/NA
The text was updated successfully, but these errors were encountered: