Allow moving meshes without motion vectors#105437
Conversation
5d70223 to
f70bd7e
Compare
|
This works very well to resolve issues with FSR 1, 2.2, and TAA on Terrain3D. All three look good without any artifact issues. Motion vectors are sane. At least this is the case on my RTX 3070. |
f70bd7e to
c27021f
Compare
c27021f to
6750f70
Compare
|
FSR 1 has no temporal components, it's purely spatial. |
|
Given the now confusing naming, an option we could also consider longterm is adding an alias
Although that would be for separate proposal, as it has implications for docs etc. Bear in mind also that this PR will need some rejigging after #104269, (or vice versa if this is merged first). |
I thought about that but decided it was out of scope of this PR since it would require me to propagate the teleport through the scene tree, something which right now I suppose an optional teleport parameter could be added to Node3D's exposed transform functions, similar to what this PR is doing internally right now.
Yeah, I also called the optional parameter "teleport" in this PR.
Yeah. I considered building this PR on top of yours for a while, but in the end decided to stick to master. This is a significantly smaller change than your interpolation refactor, so I am hoping to get it merged quickly. |
Agree is out of scope, but just to clarify my suggestion was to rename the existing
We did consider this at the time, but a separate function was preferred in general (with the idea that it would rarely be used), and it had the benefit of being backward compatible. I tended to think this made sense from an efficiency point of view too, as If you aren't rebasing on top of #104269, you can probably use the existing If this is the intention long term, I could remove the depreciation of Actually it occurs to me there is one special scenario we may not have thought of (when used in conjunction with physics interpolation): If a user has turned off physics interpolation for a branch, the resets may not be propagated currently. We may want to alter this so that the reset (for motion vectors) still gets sent to the server. This is something that can be fixed up after #104269 though. |
|
To make this PR and Physics Interpolation work in Terrain3D, we are currently doing this: They are both called right after we reposition the clipmap terrain. It would make sense to me to have one function call reset motion vectors for both PI and TAA/FSR. I think a name like |
|
Although we don't always future proof, the problem with using specific names like The user should ideally have one function to call that does it all. Consider that e.g. spatial audio should also be interpolated eventually, just to give an example. Granted that's a different server, but this collision of functionality has already occurred within |
I am convinced that we will need a generic
Honestly not really. Most of the changes here are the plumbing needed to expose the optional parameter, something I would have done anyways since being able to turn on teleportation while setting the transform is essential imo. You are correct that if I had patched that function I could have left VisualInstance3D as it is, but since I already have the teleport parameter I might as well use it. Performance is the same and code readability is better when we are explicit about setting transform with teleport enabled. However, just for completeness sake I will add teleportation to |
6750f70 to
b4fe882
Compare
5cbc661 to
b3f79f0
Compare
|
This PR was just discussed in the weekly rendering meeting. While the overall idea and design was approved, there was some argument about the exposed API. As of right now, the PR exposes the following function: However, the team pointed out that in the future we might wish to reset stuff other than the transform of mashes, and thus something along the lines of might be more future proof. However, we couldn't agree on what the new I am open to suggestions for a better name. @lawnjelly do you have any suggestions? |
|
FSR 1 will not produce MV issues because it doesn't use them (it's a purely Spatial Upscaler & Sharpener), so no need to spend your time testing FSR 1 |
If the issue still exists just report back and I will look into it some more once I am home. Looking at my PR on a phone I can't see how I could be causing this with the current version. |
b885238 to
49fd711
Compare
The quoted error was new and related to FSR. I was confirming that the error appeared only when FSR2 was enabled, and not in other modes: disabled, FSR1, etc. Nothing to do with MV in this case.
I tested more and found:
|
lawnjelly
left a comment
There was a problem hiding this comment.
Much better imo.
This should work fine and I can rejig calling instance_teleport when rebasing the SceneTreeFTI PR.
Probably needs a double check by a member of the 4.x rendering team as I'm not so active there, just to check that logic meets their needs with the motion vectors.
Imo the most important aspect to get right was always the server API function / s, because once set, these are difficult to change without changing backward compat. It is easy to fix bugs / make adjustments in the server later.
49fd711 to
77b2427
Compare
|
Tested on my terrain implementation as well and all artifacts are gone, works like a charm! |
servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h
Outdated
Show resolved
Hide resolved
77b2427 to
a4a5f4e
Compare
|
Thanks! |
This PR makes it possible to translate meshes without writing their movement to the movement buffer.
Right now, this PR integrates with the physics_interpolation feature to handle the propagation of "teleports" through the scene. To teleport something, the user simply has to update the transform and then call
reset_physics_interpolation.Alternatively the user can use the optional "teleport" parameter when calling manually calling the RenderingServer's bound transform method.
Video Example
EditorRecordingCompressed.mp4
motion_draw_disabledrender_modeto Spatial Shaders. #77523