Motion Blur - LuxRender Wiki
Luxrender GPL Physically Based Renderer

Motion Blur

Personal tools

From LuxRender Wiki

Jump to: navigation, search

Contents

Motion Blur

Overview

The motion blur effect in LuxRender is achieved using a 2 frame animation.

How to do it

Start on frame one and insert a key frame for all of your objects that will be moving. Move to frame 2. Now move/rotate your objects and insert another key frame.

At this point you may want to switch back and forth between frames 1 and 2 to make sure everything is moving the way it should. Go back to frame one. Set Luxrender to use motion blur, select objects/camera, select your shutter speed, select your blur type, then render like a normal still image.

Limitations

Adding motion blur to lights is not currently supported, only objects and the camera can utilize motion blur at this time. Also motion blur doesn't support mesh deformations (modifications to the mesh shape), but only object transformations (moving, scaling, and rotating). Finally, only linear transformations are supported: only the starting and the final position of the object will be interpolated, so it's not possible to use LuxRender motion blur to achieve curved trails as with very long exposition photography.

However, there is a workaround for all of these limitations which is described in "Alternate method" section down below.

Settings

Camera Settings (No Camera Blur)

  • shutteropen - This is a float telling luxrender when to open the camera shutter.
  • shutterclose - This is a float telling luxrender when to close the camera shutter. Longer duration between shutter open and close means more blur.
  • shutterdistribution - This is a string telling LuxRender what kind of blur to apply. Valid values are "gaussian" and "uniform".
"float shutteropen" [0.000000]
"float shutterclose" [0.500000]
"string shutterdistribution" ["gaussian"]

Object Settings

Ok, this one is a little more difficult. It can be done by hand, but it is better to use the exporter of your choice to set it up. Here is an exmple .lxo file.

ObjectBegin "Cube"
     NamedMaterial "Material"
     Shape "plymesh"
     "string filename" ["default-Cube-mat0.ply"]
ObjectEnd # Cube

AttributeBegin # Cube
     Transform [0.707106769084930420 0.707106769084930420 0.0 0.0 -0.707106769084930420 0.707106769084930420 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 1.0]
     TransformBegin
          Identity
          Transform [0.707106709480285640 -0.707106828689575200 0.0 0.0 0.707106828689575200 0.707106709480285640 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 1.0]
          CoordinateSystem "Cube_motion"
     TransformEnd
     MotionInstance "Cube" 0.0 1.0 "Cube_motion"
AttributeEnd

Camera Settings (With Camera Blur)

To blur the camera motion a similar method to the object blur is used. However, instead of a transform statement, the look at statement is used.

TransformBegin
     LookAt 9.281440 -3.488779 5.343665
          8.454678 -3.144947 4.898420
          -0.406442 0.182113 0.895343
     CoordinateSystem "CameraEndTransform"
TransformEnd

LookAt 7.481132 -6.507640 5.343665
     6.826270 -5.896975 4.898420
     -0.317370 0.312469 0.895343

Camera "perspective"
     "float fov" [49.134342]
     "float screenwindow" [-1.000000 1.000000 -0.750000 0.750000]
     "float shutteropen" [0.000000]
     "float shutterclose" [0.250000]
     "string shutterdistribution" ["gaussian"]
     "string endtransform" ["CameraEndTransform"]

Example

Motion blur.png
Motion blur of an object

Motion blur camera.png
Motion blur of the camera

Alternate method: subframes

The only way to overcome current limitations of LuxRender motion blur (short of postprocessing in graphics editor) is using subframes -- most like some other renderers implement motion blur, e.g. Blender Internal Renderer. Subframes are additional keyframe positions for the moving/deforming object between the starting and final position. More the subframes, more fluent (less discreet) will be the motion in the resulting image.

How to do it

Lets say you're going to use 10 subframes. Then between the first and the final position of object movement add 10 intermediate frame positions. For each subframe you can freely transform an object or deform its shape, but do this subtly to not have discreetness.

In the exporter of your choice set Halt SPP to 1/10 or 1/15 of the desired SPP for the final image (thus if you want to reach 5000 SPP for the final, set Halt SPP for each subframe to 500-750; if you're going to use not 10, but 25 subframes, correct the values accordingly to 1/25 - 1/37 of the final SPP) and activate FLM file saving. Now render the scene as an animation. You may also want to enable motion blur to make it smoother, but keep in mind the limitations of the normal motion blur listed above. When all frames are finished use the command line luxmerger tool (which is shipped with LuxRender) to merge all of the flm files together into the final film file. This can be done with a single command from the command line. You can now load the completed flm in LuxRender and export to an LDR or HDR image.

Subframe moblur.png

Or alternately perform an export only of each subframe after the first, then change the name to match that of the original frame and then render, this will negate the need to merge flm files, but will prevent you from further rendering of the subframes if you find it is not enough.

Limitations

With this approach you can workaround all current LuxRender limitations like no motion blur for emitters. However fast moving objects may require quite a lot of subframes and even then some discreteness (individual frames) will be visible.