This sample shows a filtering method for simulating motion blur of fast-moving objects. The method used is a 2D full-screen post-process that works on a normal framebuffer augmented with a screen-space velocity buffer; thus, filtering performance is not dependent on scene geometric complexity. The algorithm is based on the paper 'A Reconstruction Filter for Plausible Motion Blur', by McGuire et. al. (SIGGRAPH I3D'12).
This sample is an implementation of a plausible reconstruction filter for motion blur. It is a 2D multi-pass post-process implemented mostly in a GPU shader language, which has the following advantages over competing alternatives:
The algorithm takes the following as inputs:
K
(suggested values around 20).S
(suggested values around 15).Once the color buffer C
, depth buffer Z
and vertex half-velocity buffer V
(all of size w
and h
) have been generated, the algorithm performs the following passes:
TileMax(V)
:
V
as input.w/K
, h/K
), where each pixel represents a tile.NeighborMax(TileMax)
:
TileMax(V)
as input.w/K
, h/K
).C
, V
, Z
and NeighborMax
as inputs.NeighborMax
). This is done by selecting S pixels in a pseudorandom fashion along that dominant half-velocity, and the selected pixel is then weighted against the current one. This weighing takes into account depth differences and ordering (by consulting Z
).In addition to the shared controls above, the following items have been added to the TweakBar:
TileMax
pass (K
).S
).
NVIDIA® GameWorks™ Documentation Rev. 1.0.220830 ©2014-2022. NVIDIA Corporation and affiliates. All Rights Reserved.