Skip to content

Commit

Permalink
motion blur 1 frame delay fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
patsalv committed May 24, 2023
1 parent 2b289f2 commit 77e3d8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/motion-blur/src/CameraMotionBlur.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const CameraMotionBlur: React.FC<CameraMotionBlurProps> = ({
{new Array(actualSamples).fill(true).map((_, i) => {
const sample = i + 1;
const sampleFrameOffset = shutterFraction * (sample / actualSamples);

return (
<AbsoluteFill
key={`frame-${i.toString()}`}
Expand All @@ -100,7 +99,9 @@ export const CameraMotionBlur: React.FC<CameraMotionBlurProps> = ({
filter: `opacity(${1 / actualSamples})`,
}}
>
<Freeze frame={currentFrame - sampleFrameOffset}>{children}</Freeze>
<Freeze frame={currentFrame - sampleFrameOffset + 1}>
{children}
</Freeze>
</AbsoluteFill>
);
})}
Expand Down

0 comments on commit 77e3d8a

Please sign in to comment.