I’m trying to add motion blur to a physics simulation project. I’m using key type RT_MOTIONKEYTYPE_SRT_FLOAT16 applied to Transform nodes. The border modes, motion range and motion steps are default values. The 1st key is set to the previous transform from the physics engine and the 2nd key is set to the physics engine’s current transform. I’m pretty sure that the math is right in the keys since the motion blur itself looks correct when the objects are moving.
The problem I have is that when an object stops moving, Optix is still displaying motion blur, even though the 1st and 2nd keys differ only by slight round off errors. If I reset the simulation so that the 1st and 2nd keys are the same again, there’s no motion blur from Optix as expected.
In the video, I’m toggling MB on/off by changing the number of steps from 1-2 in the gui.
[url]OptixMB - YouTube
I suspect this is user error but I’ve tried everything thing I can think of and can’t fix it. Any idea what might be causing this?
I tried another render where I set the previous and current transforms equal after enough frames had passed so that the cow was motionless … and I’m still seeing the blur on the cow while it’s resting
So even when you provide the exact same SRT description for both transforms you are seeing the motion blur? If so we should get a reproducer from you so we can debug on our end. Please email optix-help@nvidia.com and I can help you investigate further.
So even when you provide the exact same SRT description for both transforms you are seeing the motion blur?
I was not able to reproduce this behavior using the optixMotionBlur sample with the following command lines, all of which should set up two keys with transforms that are close to identity:
I get an image of the cow with all these that is either not blurred or very slightly blurred, as expected. I also tried setting a non-identity transform for both keys, by modifying the sample code.
Another question: your debug output above is a combined 4x4 matrix. Are you converting back and forth between this and SRT format? Could you print the SRT elements separately, e.g., the 4-element quaternion R, the scale/shear S, and the translation T.
Do you still see blur with identical values as shown in the listing above?
If you want to email me (username @ nvidia) then I can follow up with some instructions for capturing more debug info as your program runs, so I can inspect values.
Found it! It was my bug. While debugging I could see that the previous rotations and current rotations were exactly the same when the cow had come to rest as expected. But the rotation values coming out of lerp_srt_to_key() were totally different.
The problem was that after obtaining the rotation axis and angle from my math library, I created the rotation values from the Optix Quaternion components.
Inside lerp_srt_to_key(), the Quaternion constructor was expecting the axis/angle format. Once I changed the passed in rotation to angle/axis format it works as expected.