New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Motion Blur Support #87

Open
TripleDots opened this Issue Feb 21, 2018 · 18 comments

Comments

Projects
None yet
6 participants
@TripleDots

TripleDots commented Feb 21, 2018

As seen in the image, motion blur does not affect anything created with the fluids (incl. white water particles.) But it also remove any blur on the moving object whether it's in or behind the fluid.

Tried both CPU and GPU rendering in Cycles but neither worked. It's actually kind of a cool effect.

moblurtest

(The large blobs near the head are shooting up very fast. Even with a 360 shutter angle it's not showing any motion blur.)

Weird thing is that I followed this particle spark effect and it does render motion blur no issues. https://youtu.be/QCMyvcc3ZaU

But I noticed that in the beta test video there is motion blur on a few clips. https://youtu.be/5s7L3ruVaXk
Is that post processing trickery or am I missing a feature here?

Depth of Field however does render correctly on the fluids and with objects in or behind the water as seen here. (Also tested on both CPU and GPU.)

doftest

EDIT: it's the same blend file as here #86 but with Susan made a bright orange to show the effect, the cylinder hidden from camera view and black background added.

@rlguy rlguy added the feature label Feb 21, 2018

@rlguy

This comment has been minimized.

Owner

rlguy commented Feb 21, 2018

Motion blur is not supported at the moment. It's something that we really want to be able to add but we haven't found a way to pass velocity data into Blender Cycles from an addon so that motion blur can be rendered. In the video, motion blur was added in post-processing.

At the moment, I think the most likely way to get motion blur support would be to add a feature to export to an alembic cache and attach the velocity data. But I think this still needs to be implemented in Blender. There is a Blender issue (D2388) discussing this, but it looks like no one is working on it at the moment.

I have converted this issue into a feature request/discussion. If anyone has any ideas/tips for how to add motion support, please let us know!

@rlguy rlguy closed this Feb 21, 2018

@rlguy rlguy changed the title from Fluid (w/ particles) motion blur issue to [Feature Request] Motion Blur Support Feb 21, 2018

@rlguy rlguy reopened this Feb 21, 2018

@rlguy rlguy added the discussion label Feb 21, 2018

@vmxeo

This comment has been minimized.

vmxeo commented Feb 21, 2018

Speed Vector passes with Vector Blur is another route for motion blur.

Not sure there's a direct way of accessing that from an addon. There may be some indirect ways, it'd be a kludge though.

@TripleDots

This comment has been minimized.

TripleDots commented Feb 21, 2018

I am not at all a programmer so please excuse my basic questioning, but how is cycles rendering their internal fluid system?

(Video of the internal fluid sim with motion blur.)
https://youtu.be/m2yYzhp54qk?t=8s

Also, what you could do is how people force motion blur in compositing for now which is basically layering older frames with 50% opacity. But to do it correctly fluid should be rendered separate so that this only effect fluids and things behind the fluid. If possible with sub frames. Else you get nasty looking motion blur on fast moving objects. IIRC After Effects uses their optical flow(?) technique to create subframes from already existing one. But in the 3D world you could actually generate these frames required. which in theory should look better.
This will probably not help with developing the fluid sim but it might help with working around it in compositing and/or writing a separate plugin.

@vmxeo

This comment has been minimized.

vmxeo commented Feb 21, 2018

@TripleDots There's a good explanation of motion blur and Blender's internal fluid system here: http://adaptivesamples.com/2016/07/23/motion-blur-dynamic-meshes-cycles/

It also explains why it's not always so straightforward to do on deforming meshes. Other rendering engines also let you render out a separate vector speed passes or AOVs for implementing motion blur later in post, but I haven't found a good way to do that with Cycles for dynamic meshes.

@RevDr

This comment has been minimized.

RevDr commented Feb 27, 2018

Would setting per vertex colors of the mesh to the velocity values work?

If so, (I think) these could be used within cycles: get the vertex color and transform into camera space. This image could possibly then be used to do a 2D motion blur.

@juangea

This comment has been minimized.

juangea commented Mar 5, 2018

EDIT: Ok, this was already named by Ryan so... silly additiona by my part :P

Allow me to put a note here that can help a bit with Motion Blur.

In the fracture modifier build the new remesher has now motion blur enabled, I´m not sure if they used this patch or not, but we were talking about it and I think this helped them to enable motion blur in the remesher:

https://developer.blender.org/D2388

This patch is to add motion blur to Alembic caches with variable vertex count meshes, I´m not sure why is not in master, I assume it has not been reviewed and studied enough.

Cheers!

@juangea

This comment has been minimized.

juangea commented Mar 11, 2018

But RLGuy, this has been already implemented by Scorpion81 in his Fracture Modifier branch, so maybe you can implement it here too, I don't think he modifier Cycles at all, I think he did something to his meshing system, but I think you can do this too since Cycles supports motion blur for fluid meshes and such things, it's just a matter of the information your mesh has and how it presents it to cycles, I think that, but please discuss this with Scorpion81 because he knows how to do this.

Cheers!

@Corefrecs

This comment has been minimized.

Corefrecs commented May 23, 2018

Hey RLGuy, the new Version of DualSPhysics is out with Blender support only for rendering but with Motionblur support:
https://github.com/EPhysLab-UVigo/VisualSPHysics
They use animated Shapekeys to deform the Surface within +/- 1 frame. So Maybe Shapekeys are the way to go?

@rlguy

This comment has been minimized.

Owner

rlguy commented May 25, 2018

Thanks for the tip, I only just learned what shapekeys were just now! I just tested out some scripting for manipulating the shapekeys of an object and it works and renders with motion blur. This definitely seems like the way to go to get motion blur rendering for the fluid surface!

@rlguy

This comment has been minimized.

Owner

rlguy commented Jun 3, 2018

Motion blur support for the fluid surface has been added in version 1.0.3 (now available). See this document for more information on the status of motion blur rendering for the surface and whitewater: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Motion-Blur-Support

@RevDr

This comment has been minimized.

RevDr commented Jun 3, 2018

HI,

Given the instability of the particles: is there anyway, rather than doing the motion blur in the 3D render in blender of rendering a mesh pass with the colors of the mesh and particles set to the motion vectors. i.e. red motion x component, y component is green and z is blue. By rendering out a pass this way it would be possible to do motion blur in compositing.

@Corefrecs

This comment has been minimized.

Corefrecs commented Jun 4, 2018

I made a quick test with the new Motionblur implementation:

motionblur

in the front is a regular mesh falling down. I guess the Flipfluid implementation generates a Shapekey only for one frame? I think Cycles uses the frame before AND after the current frame to render precise Motionblur. I guess that is the reason for the hard edge of the blured water mesh?

@rlguy

This comment has been minimized.

Owner

rlguy commented Jun 11, 2018

Hey, thanks for pointing this out! I had a misconception on how motion blur worked in Cycles and thought the hard edge was normal. I have modified the addon to use shapekey data for both the next frame and previous frame. This fix will be included in the next version update (1.0.4).

motion_blur_fix

@Corefrecs

This comment has been minimized.

Corefrecs commented Jun 13, 2018

Wow now THIS is awesome motionblur!
Thanks for hearing all of our requests and actualy takle them 👍 Can't imagine a reason to buy something like Realflow ;)

Cheers!

@Corefrecs

This comment has been minimized.

Corefrecs commented Aug 27, 2018

Hey RLGuy,
just tested the 1.0.4a motionblur and it works realy well! Only Thinge I noticed is, that the Motionblur strength changes with different resolutions? Sometimes a scale of 3 is „right“ sometimes 5 or more. Is this normal?
Also: is there a Chance to get motionblur for Whitewater particles soon? :)
Thanks for the Great work!

@rlguy

This comment has been minimized.

Owner

rlguy commented Aug 27, 2018

Hey Corefrecs,

The amount of blur changing between resolutions is a side effect of the workaround that we are using to get motion blur data into Blender. We attach velocity vectors to the vertices of the mesh and use those vectors to create shapekeys to morph the mesh into the previous/next frame. When the triangles become smaller (higher resolution), there is an increased chance of inconsistencies in the mesh such as triangle intersection or face-flipping and when this is resolve in Cycles, it results in a decreased amount of motion blur visually. The workaround for this is to scale the motion blur in the Display panel as you are already doing.

As for whitewater motion blur, it is unlikely that this will be supported for use in Cycles using this workaround. Adding motion blur data to whitewater particles is just too much motion blur data for Cycles to handle and results in instability/crashes with just a few thousand particles. Even using large high detail meshes with motion blur seems to be too much for Cycles to handle.

If you want to try out enabling motion blur for whitewater particles, there is a script to do so here: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Motion-Blur-Support#whitewater-motion-blur

- Ryan

@Corefrecs

This comment has been minimized.

Corefrecs commented Aug 27, 2018

Ah ok I understand. Are you using the same shapekey technic for whitewater motionblur? Maybe you can just keyframe the "particles"? I havent testet motionblur with so many particles using a simple particle system inside blender so I have no idea if this works (guess not because you said once you're using vertex duplication or something like this for the whitewater particles). Just making suggestions :D

@rlguy

This comment has been minimized.

Owner

rlguy commented Aug 28, 2018

The whitewater particles are duplicated over the vertices of a vertex-only mesh. This is how we render particles since there is not yet a way to implement some complex behaviour in our whitewater system into the Blender particle system. We use shape-keys to add motion blur data to the vertex-only meshes and then Cycles transfers this motion to the duplicated particles.

Keyframeing the particles individually would require separating each particle into a separate object which would greatly slow down Blender, taking hours to days to load a frame.

Really hope that Blender 2.8 will allow us to implement our whitewater as a particle system. It would greatly simplify loading whitewater and open up a lot of possibilities for creative rendering of particles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment