• 3D
  • How to do motion blur right?

Hello. I've been playing around with shaders and motion blur came to mind. I don't want to use the frame blending technique due to the high number of samples it needs to look okay, performance dips and the fact that the effect varies with frame rate. I'm trying to make object based motion blur, where the objects are blurred based on their movements between frames. How do I tackle this? Any help is appreciated.

You'd want motion vectors, but I don't think Godot provides this. Your best bet is probably a post process effect. This doesn't look great, but it's not super expensive, they were doing this on Xbox360 level hardware.

You can use https://github.com/Bauxitedev/godot-motion-blur. It's camera motion blur, not per-object motion blur though.

Per-object motion blur can be simulated with multiple transparent copies of the same object lagging slightly behind the original object. This works well for fan blades and the like. It's fairly straightforward to implement with a script.

@Calinou I wonder how effective it would be for a fast paced arcade racing game

Would it help at all to look at how Blender's vector blur node works? Obviously not a copy and paste job, but math is math, no matter the language. Probably too slow for real time rendering, I suppose.

@dialNforNinja said: Would it help at all to look at how Blender's vector blur node works? Obviously not a copy and paste job, but math is math, no matter the language. Probably too slow for real time rendering, I suppose.

Modern motion blur techniques usually require motion vectors, which Godot does not have. Motion vectors are far from trivial to integrate to an existing rendering engine, especially when you take all edge cases into account (transparent materials, skinned meshes, soft bodies, custom shaders, …).