Skip to content

Motion Blur Support

Ryan Guy edited this page Dec 12, 2019 · 14 revisions

This page documents the current status of motion blur support.

FLIP Fluids motion blur rendering is not currently supported due to limitations of the Blender software. Blender does not provide a method for a user or an addon/script to specify motion blur vectors on meshes that change topology between frames (such as fluids). We are actively looking for solutions and workarounds and hope to be able to support this as a feature in the future.

Potential Workarounds for the Future

  • Export motion blur data into an Alembic cache. Blender developers are working on adding support for rendering motion blur data attached to an Alembic (.abc) cache: Cycles: add support for rendering deformation motion blur from Alembic caches.. As of October 2019, there has been some recent developer activity on this feature. A potential workaround would be for us to add a feature to export the FLIP Fluids cache as an Alembic cache that contains motion blur data. Note: this would require us to develop our own Alembic exporter external to Blender's exporter since the internal exporter would not support exporting motion blur data.
  • Implement whitewater particles as a Blender particle system. Particle systems can be rendered with motion blur. The Blender Python API is currently not flexible enough for us to directly control the motion of a custom particle system for the whitewater feature. For this reason, the whitewater particles are implemented as vertex meshes, but unfortunately these cannot be rendered with motion blur. A workaround could be to have the simulator store (or convert) the whitewater simulation directly as a Blender Particle System Cache. This may require some reverse-engineering in order to understand the format of the particle system cache files. A downside of this method is that there can be some severe performance penalties for particle caches with a large amount of whitewater particles. Particle system cache files are much larger than our own compact file format and can lead to slow frame loading. However, this route may still be very useful for smaller amounts of whitewater.

A Failed Workaround

Notice: As of version 1.0.5, motion blur rendering is no longer supported due to limitations of the Blender software and large complications with using this feature in practice.

At this moment, the Blender Python API does not offer a simple method to send motion blur data to cycles for rendering. FLIP Fluids motion blur support was implemented using the following workaround:

The feature works by having the simulator export speed vector data for each vertex of the mesh. In the addon, a shapekey is added to the next frame of the fluid using the exported vector data so that the mesh can transform into the shape of the next frame and this is what Cycles uses to render motion blur for the fluid surface.

Note: This workaround only works in Blender 2.79 and is not supported in Blender 2.8x

Discussion regarding motion blur support can be found in this issue: #87

Fluid Surface Motion Blur

Motion blur rendering for the fluid surface is not currently supported. The motion blur workaround allows the surface to be rendered with motion blur, however Cycles seems to be very unstable during surface motion blur rendering. Cycles will often disregard rendering motion blur on random frames.

If you still want to try it out and enable motion blur for the fluid surface, you may due so by running the following script in the Blender text editor:

import bpy
domain_properties = bpy.context.scene.flip_fluid.get_domain_properties()
domain_properties.surface.generate_motion_blur_data = True
domain_properties.render.render_surface_motion_blur = True
domain_properties.render.surface_motion_blur_scale = 1.0

Whitewater Motion Blur

Motion blur rendering for the whitewater particles is not currently supported. The motion blur workaround allows particles to be rendered with motion blur, however Cycles seems to be very unstable during whitewater motion blur rendering. Cycles will often disregard rendering motion blur on random frames and will often quit with the following error:

Error: CUDA error: Unknown error in cuMemcpyDtoH((uchar*)mem.data_pointer + offset, (CUdeviceptr)(mem.device_pointer + offset), size), line 591
Fra:37 Mem:332.41M (0.00M, Peak 428.32M) | Time:00:46.99 | Mem:302.19M, Peak:369.28M | Scene, RenderLayer | Cancel | CUDA error: Unknown error in cuMemcpyDtoH((uchar*)mem.data_poin
ter + offset, (CUdeviceptr)(mem.device_pointer + offset), size), line 591
CUDA error: Unknown error in cuMemFree(cuda_device_ptr(mem.device_pointer)), line 615

When motion blur rendering does work, it seems to lead to an extreme increase in render times often adding upwards of an hour per frame. The problems with whitewater motion blur rendering will need to be investigated further and perhaps the issues will need to be presented to the Blender developers to gain more insight into the problem.

Motion blur rendering for whitewater is implemented in the addon, but settings are not present in the UI due to the above issues. If you still want to try it out and enable motion blur for whitewater particles, you may due so by running the following script in the Blender text editor:

import bpy
domain_properties = bpy.context.scene.flip_fluid.get_domain_properties()
domain_properties.whitewater.generate_whitewater_motion_blur_data = True
domain_properties.render.render_whitewater_motion_blur = True
domain_properties.render.whitewater_motion_blur_scale = 1.0
Clone this wiki locally