Blender Git Loki

Git Commits -> Revision f45546a

Revision f45546a by Ton Roosendaal (master)
February 6, 2006, 22:11 (GMT)
iImage based Vector Blur

After a couple of experiments with variable blur filters, I tried
a more interesting, and who knows... original approach. :)

First watch results here:
http://www.blender.org/bf/rt0001_0030.avi
http://www.blender.org/bf/hand0001_0060.avi

These are the steps in producing such results:

- In preprocess, the speed vectors to previous and next frame are
calculated. Speed vectors are screen-aligned and in pixel size.
- while rendering, these vectors get calculated per sample, and
accumulated in the vector buffer checking for "minimum speed".
(on start the vector buffer is initialized on max speed).

- After render:
- The entire image, all pixels, then is converted to quad polygons.
- Also the z value of the pixels is assigned to the polygons
- The vertices for the quads use averaged speed vectors (of the 4
corner faces), using a 'minimum but non-zero' speed rule.

This minimal speed trick works very well to prevent 'tearing' apart
when multiple faces move in different directions in a pixel, or to
be able to separate moving pixels clearly from non-moving ones

- So, now we have a sort of 'mask' of quad polygons. The previous steps
guaranteed that this mask doesn't have antialias color info, and has
speed vectors that ensure individual parts to move nicely without
tearing effects. The Z allows multiple layers of moving masks.

- Then, in temporal buffer, faces get tagged if they move or not
- These tags then go to an anti-alias routine, which assigns alpha
values to edge faces, based on the method we used in past to antialias
bitmaps (still in our code, check the antialias.c in imbuf!)

- finally, the tag buffer is used to tag which z values of the original
image have to be included (to allow blur go behind stuff).

- OK, now we're ready for accumulating! In a loop, all faces then get
drawn (with zbuffer) with increasing influence of their speed vectors.
The resulting image then is accumulated on top of the original with a
decreasing weighting value.

It sounds all quite complex... but the speed is still encouraging. Above
images have 64 mblur steps, which takes about 1-3 seconds per frame.

Usage notes:

- Make sure the render-layer has passes 'Vector' and 'Z' on.
- add in Compositor the VectorBlur node, and connect the image, Z and
speed to the inputs.
- The node allows to set amount of steps (10 steps = 10 forward, 10 back).
and to set a maximum speed in pixels... to prevent extreme moving things
to blur too wide.

Commit Details:

Full Hash: f45546a1d31f4c8ecd24b45d12da14d958608f9b
SVN Revision: 6732
Parent Commit: 4c59280
Lines Changed: +813, -202

15 Modified Paths:

/source/blender/blenkernel/BKE_anim.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/anim.c (+13, -12) (Diff)
/source/blender/blenkernel/intern/node.c (+3, -0) (Diff)
/source/blender/blenkernel/intern/node_composite.c (+28, -25) (Diff)
/source/blender/render/extern/include/RE_shader_ext.h (+2, -2) (Diff)
/source/blender/render/intern/include/renderdatabase.h (+2, -0) (Diff)
/source/blender/render/intern/include/render_types.h (+10, -1) (Diff)
/source/blender/render/intern/source/convertblender.c (+250, -149) (Diff)
/source/blender/render/intern/source/pipeline.c (+13, -3) (Diff)
/source/blender/render/intern/source/rendercore.c (+18, -7) (Diff)
/source/blender/render/intern/source/renderdatabase.c (+23, -3) (Diff)
/source/blender/render/intern/source/zbuf.c (+426, -0) (Diff)
/source/blender/src/drawnode.c (+20, -0) (Diff)
/source/blender/src/editnode.c (+1, -0) (Diff)
/source/blender/src/previewrender.c (+3, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021