-
Notifications
You must be signed in to change notification settings - Fork 193
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
Comments
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! |
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. |
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.) 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. |
@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. |
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. |
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! |
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! |
Hey RLGuy, the new Version of DualSPhysics is out with Blender support only for rendering but with Motionblur support: |
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! |
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 |
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. |
I made a quick test with the new Motionblur implementation: 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? |
Wow now THIS is awesome motionblur! Cheers! |
Hey RLGuy, |
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 |
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 |
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. |
Dumb question: If I import an alembic white water file, it tries to use motion blur on the particles. This motion blur is sometimes very chaotic. My intuition (often erroneous) tells me that perhaps it's based on the vertex index number and that the vertex numbers are not always positioned close to the same vertex number on the proceeding frame. Motion blur and smoke with sub-frames (using the spray object which isn't alembic) both act in this chaotic manor - sometimes crashing blender. If the white water vertices were indexed with their location to more correspond with proceeding frames, would everything work better? It seems to me that it would be easier for blender to calculate it. My assumption is probably wrong but I had to ask. I hope my description makes sense. |
Hey guitartom47, That's very interesting! I had never thought that Blender would try to derive motion blur from the Alembic cache. My first guess would also be that Blender is using the vertex index of the meshes. And if this motion blur works like the shapekeys workaround, it might be comparing the current frame with both the previous frame and next frame. The difficult part about getting motion blur to work in this way is that in our whitewater system, thousands of particles are being removed every frame (and also birthed). The vertex order is constantly changing. If Blender calculates two vertices to be the same between frames, and these particles happen to be very far away from each other spatially this will put a huge strain on the renderer when it calculates the BVH tree. It could be possible to improve motion blur results by ordering vertices in a smart way, but is not so simple to implement. And also, not guaranteed to work. Lately I have been experimenting with writing the whitewater cache files in the blender .bphys file format that particle systems use. This could make it possible to render motion blur on particles properly and also make it possible to add other rendering effects such as colours based on velocity. But during testing I have run into huge performance problems when trying to load over a million particles:
Right now it is not looking very likely that we will be able to implement whitewater particles as a ParticleSystem. |
If it were possible (it sounds difficult) to keep track of the particles, it might help in other ways as well! What brought me to this motion blur observation was that I've been experimenting with bringing in an alembic 4th white water 'sand' particle. I had to bake my flip twice to achieve that. My sand is randomized in color, and I suspect that if I were to do closeups, it would have quite a grainy flicker. (I'd like to post about this in the appropriate place as soon as my render completes.) As to color changes, I've been wanting to change the color of my water by using it's proximity to bubbles or foam - thinking this might help to use less particles but maintain realism. There's an attribute node in materials but it won't allow the use of vertex weight. Vertex colors are usable but not for the fluid object (because of it's animation?) - so no dynamic painting unless blender introduces new modifiers to add vertex colors. Thanks for the response! Hope this helps in some way!! edit: your decoupling idea might help with the double baking for sand or dust!! It seems like it would take tremendous amounts of drive space though! |
RlGuy, Had you considered using the .bphys format, but using to compress the particle data. I am not sure if this would work, but If rather than having a separate blender particle for each of yours have a seperate blender particle for each 'live' particle of yours. That would mean that you could reuse blender particles for different flip sim particles. All you would need to is 'park' blender particles at some crazy location when not in use. For example You could compress that down to two Blender particles that has 'sensible' data at This should dramatically reduced your files sizes. However, Anyway, Just a thought - but you may have had it already. |
Hey RevDr, I have thought about this a bit. This method would be a workaround to this problem:
For example: if the simulation cycles through 100 million particles in a sequence, but at most 6 million are contained in a single frame, this file would only require listing 6 million particles. But a problem is that this could increase the cache size of a sequence overall if the simulation fluctuates in the number of particles per frame. The .bphys format only allows particles to be born once and die once, so there could be a range of frames where the files would be storing many 'parked' particles. An example scenario:
This would mean that the cache files would need to store all 6 million particles between frames 100 to 200. Which is about 500MB per frame!
I would assume that Blender would use the velocity attached to the particle for motion blur
Yeah, there might be some parts of a ParticleSystem that would not work correctly if it uses the particle age. But for material/shading purposes, we could work around this by storing the real particle age in another attribute such as 'color'. A way to work around having these huge files might be to write all particle data in our own compact format, and then generate the .bphys cache files 'on demand' when loading a new frame. I haven't tested this, but some problems I can think of:
|
For anyone who is interested, I am including a link to examples of white-water motion blur made possible by following the directions here: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Motion-Blur-Support. From my own memories of trying this months ago, directly in the render, motion blur would sometimes lock up or destabilize the renders of individual frames. What I never realized was that ALL the motion blur data was always present and correct. When I used the vector blur node in compositing instead of trying to render the blur in cycles, every frame stabilized enough to render it out. Unsurprisingly, because of the vector pass, frames took longer because Blender took time to collect info from three frames instead of just one to calculate the blur data. As I rendered out my animation, I realized that even when just using the vector blur node, some frames were chaotic with respect of the white water blur. The chaos ranged from completely wild to very subtle. Sometimes it was so subtle that I only saw it in the rendered video afterward as a flicker. I never really came to a conclusion as to why it happened. Sometimes I would have as many as ten frames render with no problem, and some days I could get barely any to render. I think restarting the computer may have helped at times. Also I often prayed to the render gods. Here's the thing. I could get every frame that glitched to render perfectly after another try or two or five. I created a work flow after much frustration that used multilayer openexr as output - so that I could go back and just render the vector pass and nothing else. Is the render blur problem the fault of Blender or a bug in the FLIP addon? I couldn't tell - but I do know that I've had similar problems using just the fluid object blur - though not as prevalant. In those times I'd monitor the render and see that inividual frames would suddenly, hugely slow down and seem to lock up. SOP was to stop blender in the windows task manager or the system console, open Blender again and then retry. Included in the link are two examples of my work. It's a sunset scene so I left it a little dark. One scene is how everything should be with correct motion blurred white-water and surface. The other is how it would look if I had left everything un-rerendered. About two thirds of the way though I finally decided that since the foreground was blurred I would give up on the motion blur. All was rendered with Blender 2.79 E-cycles. Surface tension was on but no sheeting. Resolution was set at 1000. (to be self critical I much would have preferred 1400 - I've tried it before and it looked wonderful - but Blender doesn't like that so much. Also so much more time would be involved - a good argument for adaptive fluid sim of some sort) This animation is still incomplete but I needed to share my findings nevertheless. Link to downloadable video files: https://1drv.ms/f/s!AuL_h2DNeOJciI4s5gWpYsI5ViPulQ |
Hi,
FYI my Baptism project I used the vector pass and then used that for a vector blur in post as that seemed the most stable way at the end of last year.
https://www.youtube.com/watch?v=M0rX6V0XSxo<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DM0rX6V0XSxo&data=02%7C01%7C%7C7ebc88a75f624405b60508d70119b642%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636979082246798595&sdata=puFslTIgQHES8amCjV1AkJlgjtBOtM9KUXapAMV8YWk%3D&reserved=0>
However, since the end of my sabbatical; I have rarely started up blender so not sure of the situation now.
God bless
Rob
From: guitartom47 <notifications@github.com>
Sent: 11 July 2019 16:31
To: rlguy/Blender-FLIP-Fluids <Blender-FLIP-Fluids@noreply.github.com>
Cc: RevDr <itfcrob@hotmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [rlguy/Blender-FLIP-Fluids] [Feature Request] Motion Blur Support (#87)
For anyone who is interested, I am including a link to examples of white-water motion blur made possible by following the directions here: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Motion-Blur-Support<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frlguy%2FBlender-FLIP-Fluids%2Fwiki%2FMotion-Blur-Support&data=02%7C01%7C%7C56097cc7adf44f3954c608d70614cec5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984558742374561&sdata=CM3vxQ7%2F4y1eJHmzxAi2ibQqjZipQoCPxFqTHUefExg%3D&reserved=0>.
From my own memories of trying this months ago, directly in the render, motion blur would sometimes lock up or destabilize the renders of individual frames. What I never realized was that ALL the motion blur data was always present and correct. When I used the vector blur node in compositing instead of trying to render the blur in cycles, every frame stabilized enough to render it out. Unsurprisingly, because of the vector pass, frames took longer because Blender took time to collect info from three frames instead of just one to calculate the blur data.
As I rendered out my animation, I realized that even when just using the vector blur node, some frames were chaotic with respect of the white water blur. The chaos ranged from completely wild to very subtle. Sometimes it was so subtle that I only saw it in the rendered video afterward as a flicker. I never really came to a conclusion as to why it happened. Sometimes I would have as many as ten frames render with no problem, and some days I could get barely any to render. I think restarting the computer may have helped at times. Also I often prayed to the render gods.
Here's the thing. I could get every frame that glitched to render perfectly after another try or two or five. I created a work flow after much frustration that used multilayer openexr as output - so that I could go back and just render the vector pass and nothing else.
Is the render blur problem the fault of Blender or a bug in the FLIP addon? I couldn't tell - but I do know that I've had similar problems using just the fluid object blur - though not as prevalant. In those times I'd monitor the render and see that inividual frames would suddenly, hugely slow down and seem to lock up. SOP was to stop blender in the windows task manager or the system console, open Blender again and then retry.
Included in the link are two examples of my work. It's a sunset scene so I left it a little dark. One scene is how everything should be with correct motion blurred white-water and surface. The other is how it would look if I had left everything un-rerendered. About two thirds of the way though I finally decided that since the foreground was blurred I would give up on the motion blur. All was rendered with Blender 2.79 E-cycles. Surface tension was on but no sheeting. Resolution was set at 1000. (to be self critical I much would have preferred 1400 - I've tried it before and it looked wonderful - but Blender doesn't like that so much. Also so much more time would be involved - a good argument for adaptive fluid sim of some sort)
This animation is still incomplete but I needed to share my findings nevertheless.
Link to downloadable video files: https://1drv.ms/f/s!AuL_h2DNeOJciI4s5gWpYsI5ViPulQ<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F1drv.ms%2Ff%2Fs!AuL_h2DNeOJciI4s5gWpYsI5ViPulQ&data=02%7C01%7C%7C56097cc7adf44f3954c608d70614cec5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984558742394578&sdata=oa2xbxhu6oZ%2FHm6%2FEZEXfs%2FB%2Bb2gSzIxp6C9T3DNDxc%3D&reserved=0>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frlguy%2FBlender-FLIP-Fluids%2Fissues%2F87%3Femail_source%3Dnotifications%26email_token%3DAIV3XHVQMH3XC7U7GTAW2VDP65G4BA5CNFSM4ERTVGA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXCPQA%23issuecomment-510535616&data=02%7C01%7C%7C56097cc7adf44f3954c608d70614cec5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984558742404583&sdata=7ESD2ydYblZTjx88mOiwCXc8rEsm4DTpcvDbnf%2BKESw%3D&reserved=0>, or mute the thread<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIV3XHW3PBBVO4FE42OKM3LP65G4BANCNFSM4ERTVGAQ&data=02%7C01%7C%7C56097cc7adf44f3954c608d70614cec5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984558742414594&sdata=0ujT7bKmGK3M7RA9%2Fj1iems4DX3iY46qozUtUZJ1jYg%3D&reserved=0>.
|
RevDr, that's beautiful and incredible!! I didn't realize that you were using the same technique! If your renders were more stable, I wonder if the instability happens as blender (or even FLIP) has to juggle more and more data... |
Hi,
Thanks for the kind comments.
Having reread your emails, just a couple of comments:
1. When using the vector nodes I too had some vector passes I had to re-render. I got some similar looking artefacts to you sometimes. One thing (you probably know) you can do is to disable the overwrite flag in blenders render options. When you do have to rerender that means you can just delete the ‘broken’ frames and the rerender. I would occasionally get some off things happen in the beauty pass too. (I am not sure if the overwrite flag trick would not have worked without me doing 4. on my scene though)
2. Some of my sims were pretty big – I had the resolution as high as my 64GB RAM would allow – I am not sure how they compare to yours in size. The ‘heart shot’ took 5 days to sim. I can’t however, recall the vector passes being less consistent on the bigger sims than not – although I never looked for that.
3. As far as I recall there is no vector blur data for the white water due to memory/efficiency issues if they were included. However as most of the time there was enough fluid surface on my sim I kind of got away with it. This may have changed since I did the Baptism project. I have been too busy with church to keep up with what has been happening the past 6 months or so.
4. I made a code change to FlipFluids locally as I had keyed one of the frame offset values (again a little vague now) and it didn’t always work as it was. I think that change might have made it into the main release though.
5. Not that it makes any difference – but I did my ocean as a separate render pass (it was a all done with a displacement to a plane at render time) to the flip fluids one pass then did a composite of them together (both beauty and vector pass obviously needed comping)
PS – love your sunset look – looks really amazing!
Bye for now
From: guitartom47 <notifications@github.com>
Sent: 12 July 2019 01:57
To: rlguy/Blender-FLIP-Fluids <Blender-FLIP-Fluids@noreply.github.com>
Cc: RevDr <itfcrob@hotmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [rlguy/Blender-FLIP-Fluids] [Feature Request] Motion Blur Support (#87)
RevDr, that's beautiful and incredible!! I didn't realize that you were using the same technique! If your renders were more stable, I wonder if the instability happens as blender (or even FLIP) has to juggle more and more data...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frlguy%2FBlender-FLIP-Fluids%2Fissues%2F87%3Femail_source%3Dnotifications%26email_token%3DAIV3XHWS6OMDAXT2HZCMFGTP67JFNA5CNFSM4ERTVGA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZYLXDY%23issuecomment-510704527&data=02%7C01%7C%7Cc9b14ed405864c7257e008d70663d5cc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984898161632239&sdata=qvxjcuUMl8X0FEyNAubTGfSu1vxhyWedBAFVgZcpfWU%3D&reserved=0>, or mute the thread<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIV3XHTGPN36XTKCJEAWPPLP67JFNANCNFSM4ERTVGAQ&data=02%7C01%7C%7Cc9b14ed405864c7257e008d70663d5cc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984898161642262&sdata=VlxmQh2NcxJghMr%2By4kHRA2JPe%2B28TKRbDi%2BSVmmxng%3D&reserved=0>.
|
Don't know if this will be appropriate or relevant, but decided to share anyway.
BUT while rendering blender could randomly crash. Can crash after 10 frames, can render 500 and still going, but seems like more geometry is in cached mesh the more chances it will. Going for debugging blender's src brought me nowhere but to assumption the crash is due to some race condition while setting shape_key vertices data and blender calling notifiers or something like this(crash at any of the v.co assignments in _update_motion_blur()). The solution for me was to render everything from command line, as described in #1200 JacquesLucke/animation_nodes#1200. I do not believe #1200 is related to my crashes, although looks very similar, but at the end of day it seems like blender -b scene.blend -a renders my sequences just fine and without crashing(so far). This is not a solution, and maybe not suitable to be here, but google leads here, and maybe this rather dirty hack to make it possible at all(at any cost you can tell) can be helpful. |
My apologies for the ping on this issue thread, just cleaning up the FLIP Fluids GitHub issue tracker. Motion blur rendering is possible for the FLIP Fluids surface and whitewater particles in Blender 3.1 or later, however there is a currently a bug in Blender (T88811) where command line rendering will be necessary to prevent crashes. More information about motion blur support can be found here: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Motion-Blur-Support |
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.
(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.)
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.
The text was updated successfully, but these errors were encountered: