-
Notifications
You must be signed in to change notification settings - Fork 192
Motion Blur Support
This page documents the current status of motion blur support.
As of FLIP Fluids 1.5.0 (07-sep-2022) in Blender 3.1 or later, Cycles motion blur support has been improved and is supported on both the liquid surface and whitewater (foam/bubble/spray/dust) particles by exporting and using the FLIP Fluids velocity attribute. However, these features are hidden by default due to a current bug in Blender that can cause frequent render crashes or incorrect renders when using these features. See the FLIP Fluids Preferences > Developer Tools documentation for affected features, a workaround to this bug, and how to enable these features.
Related Documentation
- See the Domain Attributes and Data Settings > Motion Blur Rendering: Automatic Setup documentation for how to quickly get started with motion blur rendering.
- See our Motion Blur and Attributes example files for basic Blend file setups including notes.
- See the FLIP Fluids Sidebar Helper > Geometry Node Tools > Initialize Motion Blur operator to automatically set up motion blur rendering.
Alternative: A popular workaround is to add motion blur as a post-processing effect using software such as Adobe After Effects, DaVinci Resolve, and ReelSmart Motion Blur.
Update (25-nov-2021): this potential solution is no longer needed. See the topic above (Experimental Motion Blur Support).
- 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.
Update (25-nov-2021): this potential solution is no longer needed. There is now a solution in Blender for attaching motion blur data to an Alembic export. See the topic above (Experimental Motion Blur Support).
Blender now supports rendering motion blur on an Alembic cache that contains motion blur data (D2388).
At the moment, attaching velocity data to Alembic files will be the best way to add motion blur support. And this should work if we format the velocity data in a way that Blender supports. There are some complications with adding this feature on our side that will need to be tackled in future development. Notes:
- We will need to develop our own Alembic exporter that runs outside of Blender. Blender's Alembic exporter does not have functionality for us to add our own velocity data through Python, so we will need to do this ourselves.
- The Alembic library and documentation looks to be a bit difficult to work with and understand. There are posts of those looking for Alembic help having trouble finding answers on forums. The best resource found to learn how to develop with Alembic is by looking at the Blender codebase, thanks to being open source.
- To distribute Alembic with our addon on Windows, we will need to switch C++ compilers to a compiler that Alembic supports. Unfortunately, the compiler we need to use (Microsoft Visual Studio) will add a 10% - 15% performance penalty on the simulator. We do plan to eventually switch compilers in the future, but first want to finish a project on greatly improving simulator performance before we make a change that slows it down.
- As for supporting motion blur on whitewater particles, it's not certain if Alembic will work correctly due to rendering performance issues on millions of mesh instances. For motion blur support on particles, it will be better to implement our whitewater as a Blender particle system. This isn't currently possible, but may be in the future when Blender adds their updated and new particle systems.
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
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
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