Thanks for all the comments.
I have create motion blur branch if you want to test this. It’s still OpenGL only and don’t support instancing.
To see motion blur in action, just see sample 98_ObjectMotionBlur. It will produce scene like this:
If you look closely, it looks somewhat weird and teapot don’t look blended to background. That’s happen because velocity buffer only store it’s own pixel velocity. Surrounding background pixels didn’t have velocity data, so it don’t get blurred. There are some solutions to solve this problem, the common method used in other engines are from this paper. I plan to look into this too.
Anyway, if you want to use motion blur to other samples or your projects, just add this before set your viewport:
[code]
// To see motion blur more clearly
Engine* engine = GetSubsystem();
engine->SetMaxFps(30);
ResourceCache* cache = GetSubsystem();
Renderer* renderer = GetSubsystem();
renderer->SetDynamicInstancing(false);
renderer->SetDefaultRenderPath(cache->GetResource(“RenderPaths/ForwardMotionBlur.xml”));[/code]Hope this will be useful.
Didn’t primitive add per drawable shader parameters a week or two back?[/quote]
It is still in a topic/feature branch, and not in the master branch yet.[/quote]
What branch is that?
In my implementation, I passed previous frame camera and object matrix at UpdateBatches() function. I feels like this method isn’t optimal because batch will always calculate and send the matrix to GPU despite if you don’t want to use them. Unrelated to motion blur, I found this behavior common in Urho, for example, cCameraPos uniform still passed to shader even tough it’s in rendering post processing quad. Sometimes it’s useful to some method, but most of the times, it doesn’t. I’m not expert on OpenGL (or DirectX), but does this really affect performance?