Implement motion blur feature based on the community plugin#115027
Implement motion blur feature based on the community plugin#115027HydrogenC wants to merge 3 commits intogodotengine:masterfrom
Conversation
|
Already feature complete and workable, but API might be subject to change. We may want the API to get reviewed first before marking this PR as ready. |
|
All the third-party content needs to be correctly attributed, this currently violates their license Edit: especially seeing how it's so directly copied you even copied typos and TODOs from the original 🙃 |
I'll do it. |
|
I apologize for the bother, I should have been cleaner and clearer about the setup. |
|
@HydrogenC Please update the PR's description with the following: (EDIT: THE CHANGES REQUESTED HAVE BEEN MERGED BY THE OP) |
Not really. I made plenty of modifications actually. The TODOs are there because they are not yet resolved so I keep them to hint future contributors. For the TODOs that I have resolved, I already removed them. This doesn't mean that this PR is underworked. |
Nor did I say so! |
|
Only works for PracticalCameraAttr? Also I notice that then v-sync is disabled I can barely notice the blur |
We can move it elsewhere if required, like to environment. Now it's under practical camera attributes. |
Yeah I mean, I dont mind that is there, but its not present in PhysicalCameraAttr |
|
When rendering driver is d3d12 this happens: Properties do not appear until you reopen camera_attributes resource: This one is hard to see but when you run the project with motion blur enabled a little flickering can be seen: Only camera rotation gives effect: I think some properties should be changed in rendering/camera instead of in the camera_attributes: |
|
Wow this is a lot. The second issue can be fixed with calling |
Intensity is set to 100.0 in that clip if you are talking about that |
I think it is fine in PracticalCameraAttr, as the base class (CameraAttr) has only stuff regarding exposure & auto-exposure & PhysicalCameraAttr also has the same, only with frustum added. So, if required, we could change it. |
@AThousandShips I have a small question. I've done some debugging on this problem and I found removing specification constants fixes the problem. Is specification constants unsupported in the D3D12 backend? |
You may want to also ask @clayjohn |
Is fixed with |
|
I unfortunately can't help with rendering questions clay would be a better person to respond, and I'm sure he will when he has the time |
9f428ff to
5c284ec
Compare
|
@HydrogenC I have a fix for the 4th issue: |
|
sphynx-owner, I'm very happy to see your involvement in this PR, even if just from a testing and review perspective. This sort of testing and insight from an expert on the subject is invaluable to the development of these features! Thank you! |
|
Every setting in rendering has this Edit: |
I was using the Github App GUI to do the rebase, and it left a mess if the network fails in the middle. 😞 |
787e16d to
cf45e1e
Compare
When looking at a PR for the first time, I like to review the newly exposed public facing API by simply looking at the docs files to see what was added. Would it be possible to run |
@AR-DEV-1 Will you take this when you have time? |
|
@AR-DEV-1 the latest commit seems broken. Roque curly brackets. |
Ye though a bit off topic , but keep expectation low for hddagi , nothing can be sure at all until there’s a new pr or some progress being shown. |
|
One of the main reasons for a feature PR to be merged is that the feature cannot be implemented as a plugin or there are substantial compromises to implementing it as a plugin. In the description, I see a mention that performance should be better with this PR compared to the plugin, but it would be good to see some real world and benchmark performance comparisons between this PR and the plugin to demonstrate how substantial the performance gains are. This will help validate that this PR is worth the long term maintenance cost. It would also be good to have this PR's description list and detail any other improvements or benefits to having this feature added to Godot compared to what was possible with the plugin. These will, again, help demonstrate why the long term maintenance of the feature is truly required and cannot be handled by a plugin. |
|
Let's stay on topic |
|
File formatting & etc, failing. Will format them |
|
Oh my, only noticed this PR today, you're the man @HydrogenC! Unfortunately busy with my day job but as soon as I'm able, I'm gonna get around to testing this PR thoroughly! ❤️ Regarding motion blur in the editor, IIRC in Unreal motion blur is rendered in editor, I think their reasoning is that it can affect how things like animations and camera pans look for example and you'd ideally wanna see how they look without having to run your game. However, in Unity, it's not rendered in editor. Ideally of course a project option that allows you to chose would be best. Regarding the full suite of options @sphynx-owner has implemented in the plugin, I think for an initial motion blur implementation into core, just the core, fundamental effect should be the priority. Once that's done, we can then implement things like framerate independent motion blur, camera/object separated motion blur, ect, as additional PRs afterwards. I think this is also more in line with how features/enhancements are generally tackled with Godot development? |
Yeah, the current status is that all of these additional and advanced stuff are actually already implemented in this PR. Now the problem is that the number of parameters is above the number that keeps the effect simple so we have to scale them down (which means that the hardcoded parameters will possibility never be added back as configurable ones). |
|
I personally believe that the current implementation is complete and coherent. There is still some discussion around the tile size property that needs resolving, but given the documentation I added we should be on the same page on what the different proeprties mean at least. |
I think these are key features that shouldn't be stripped out of this PR. I hope the maintainers won't decide to remove them for the "initial" implementation. What parameters will be configurable by users can and should be discussed and stripped down if it makes sense, but since motion blur is mostly an artistic tool, I'd argue, it should be treated as such (instead of only a tool to smoothen things out for 30fps games) since not all games will need the same look. |
8d718f6 to
6839494
Compare
4d828f1 to
96db643
Compare
|
I forgot to mention: thanks for providing the generated docs for this PR! That makes it much easier for everyone to start review of the PR. I have been overwhelmed working on HDR ouptut, so I'm not sure if I'll be the person to review this PR, but the public-facing API is critically important to review, as this cannot easily change, if at all, between Godot versions. I noticed that my previous comment received a lot of confused emojis, so I understand that there might be some confusion about what I wrote. I'll provide some clarification: I wrote that note from the perspective that is generally taken with all PRs in Godot. This process helps us ensure a high quality, bug-free, maintainable game engine in the long run and is why we ask "Is there a reason why this should be core and not an add-on in the asset library?" in the proposal template. I noticed that the proposal for this PR has notes about how this PR should be better than the existing plugin. All that said, I was not aware that a decision may have been made to include a motion blur feature in the Godot engine without the need for a plugin. So assuming that this decision has been made, it is still important to verify the performance characteristics of this PR and any differences/improvements/etc. that have been made compared to the plugin. This not only gives validation that integrating the feature into the core engine is valuable, but also ensures that the quality and characteristics of this PR are as-expected. So, regardless of the exact reasons, seeing some performance comparisons and details regarding any other improvements or benefits compared to the plugin this PR is based off of will still be extremely valuable in the review of this PR. If others who are interested in this PR are able, it would be good to test this PR with your own project to see how it performs, etc. Once a bug, problem, or limitation has been merged into Godot it becomes much harder to fix later on, so lots of testing of PRs is always appreciated! |
Graphics part by @HydrogenC, editor part mainly by @AR-DEV-1 & docs mainly by @sphynx-owner Co-Authored-By: AR <ardev1.deverson@proton.me> Co-Authored-By: sphynx-owner <61445300+sphynx-owner@users.noreply.github.com>
At the godot priorities, they mention the motion blur pr and that they wanted to add common effects as built in . See https://godotengine.org/priorities/#significantly-improve-post-processing-effects |
In our priorities, it is clearly mentioned the need for built-in common effects & the motion blur PR is also mentioned there. (Edit: Saul said the same thing as me, I just found about it now) |




This PR implements the motion blur post processing based on the community plugin created by @sphynx-owner . The original repos could be found here: https://github.com/sphynx-owner/godot-motion-blur-addon-simplified and https://github.com/sphynx-owner/JFA_driven_motion_blur_addon.
Closes godotengine/godot-proposals#12258 and godotengine/godot-proposals#2933.
There are some differences compared to the original plugin, notably:
This PR is co-authored with @AR-DEV-1 , with me doing the graphics and shaders part and @AR-DEV-1 working with the editor settings parts.
Supported backend: Forward+.
Preview:

Docs not yet written, since the API itself may be subject to change during review. Docs will be finished by @AR-DEV-1 after the API itself gets approved.The current blocker is that the current implementation exposes too many parameters, we may have to scale the number down and make some of them constant instead.
Note
godot-cppwill also be modified with these changes after the the API itself gets approved. The build for the editor with mono on Linux can be ignored for now.