rlguy / Blender-FLIP-Fluids

The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.
https://www.blendermarket.com/products/flipfluids
GNU General Public License v3.0
1.64k stars 185 forks source link

Fluid gets darker once in a while when motion blur is enabled #534

Closed yiusay closed 3 years ago

yiusay commented 3 years ago

Blender Version (including hash): 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 02948a2cab44 FLIP Fluids Version: 1.0.9b Operating System: Windows-10-10.0.19041-SP0 64 Bits CPU: Intel Core i9-9880H @ 2.30GHz GFX: GeForce RTX 2080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.40 RAM: 32GB

Describe the bug

When the fluid is rendered using cycles and Motion Blur is enabled, the fluid gets dark in some frames. This seem to happen kinds of randomly. If the fluid cache is deleted and baked again, the problem happens in different frames.

For the motion blur settings, this problem happens when Position is set to "Center on Frame". If Position is set to "Start of Frame", the problem does not seem to happen. I understand that Flip fluids itself is not supporting Motion Blur but sometimes I need to enable it to produce motion blur for other moving objects in the scene.

To Reproduce

Open this blend file (https://drive.google.com/file/d/1G3pe6Pdn29RHyYjE6ZRFI_ZcVjzFZlEC/view?usp=sharing) and render animation without deleting cache. You will see that the rendered fluid in frame 282 and 525 is darker relative to the fluids in other frames.

Delete the cache and bake the fluid. Then, render animation using cycles again. There will be some frame where the rendered fluid is relatively darker.

Expected Behaviour

The fluid in all the frames should be rendered in a similar color.

Actual Behaviour

A description of what actually happened.

Screenshots

0280 Frame 280 0281 Frame 281 0282 Frame 282 0283 Frame 283 0284 Frame 284

All the rendered images can be downloaded from here. https://drive.google.com/file/d/1NudENeIBTLT1FW_IKjTwc77wt5hioC7T/view?usp=sharing

Open 0282.png and 0525.png and compare their fluid color with the ones in other frames.

rlguy commented 3 years ago

Thanks for the report! I am able to reproduce this issue using Blender 2.92 and the supplied cache. Here is what I think is the cause of this issue:

By coincidence, the surface mesh in frames 281 and 282 contain the same number of vertices and faces. Blender thinks it can make sense of this data and is generating motion blur data. Since the frames change topology, the motion blur data will be incorrect and this is what is causing an incorrect render on some frames.

Workarounds:

Blender 2.92

Motion blur rendering can be disabled for the surface mesh (and whitewater objects) in the object properties here:

disable_motion_blur

This will prevent Blender from attempting to generate motion blur data for this object.

Blender 2.93 (beta)

This issue does not seem to happen in the Blender 2.93 beta, so I assume this issue has been fixed in Blender

Create a new simulation in FLIP Fluids 1.0.9b (06-APR-2021)

In FLIP Fluids 1.0.9b, the addon will automatically disable the motion blur option when creating a new domain to avoid these types of issues. This only applies to scenes that were created in 1.0.9b. I noticed that your scene began in the 0.0.9a demo and then was updated to 1.0.9b and this may be the reason why the motion blur option was still enabled on your surface object.


Hope this info helps!

yiusay commented 3 years ago

Great. Thank you!