Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unsure if motion Vectors are working as i expected #7

Open
PlasmaDev5 opened this issue Jan 3, 2023 · 12 comments
Open

[BUG] Unsure if motion Vectors are working as i expected #7

PlasmaDev5 opened this issue Jan 3, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@PlasmaDev5
Copy link

This is the output of motion vectors under movement.
image

Velocity source texture is set to RGBAHalf
Using Deferred -> Sky -> Transparent -> Motion Blur (After Sharpening)

@PlasmaDev5 PlasmaDev5 added the bug Something isn't working label Jan 3, 2023
@na2axl
Copy link
Member

na2axl commented Jan 3, 2023

The Velocity source doesn't need to be rgbaHalf, just rgHalf is enough.

Have you tried to update the velocity strength in the pass parameters? Be aware the final motion vector strength will be scaled with the camera's ShutterTime and the frame's delta time too. Also, what do you mean by "as I expected"? I'm curious to know what you wanted as output.

@PlasmaDev5
Copy link
Author

In my branch im currently packing some of the clearcoat data into the alpha so i dont have to make an additional buffer.
From testing it seams to be harmless enough unless its somehow whats effecting motion vectors but i doubt it.
The main thing of concern is the screen space position gradient (red left, green top)
i was kinda more expecting something like the image below but without the arrows, color representing direction, brightness for strength
image

@na2axl
Copy link
Member

na2axl commented Jan 3, 2023

Ok got it...

First, I'm not sure but these values seem to be a bit exaggerated for me, maybe the renderer used to create your image has scaled the vectors to make them noticeable on screen? Because AFAIK for the motion blur effect, motion vectors should be really small to not distort the final image.

Secondly the motion vectors in the image seem to be in 3D space (I'm saying that because of the purple-blue variation). But the motion blur is building his motion vectors on the screen space, you can only have black, red, green and yellow colors. And also the color space variation is not static and depends on the camera position.

image

image

I feel like what you want instead is vertex velocity?

@PlasmaDev5
Copy link
Author

is it normal that i still have the screenspace gradient even when everything is static
image

@na2axl
Copy link
Member

na2axl commented Jan 4, 2023

No surely not, can you please share your render pipeline?

@PlasmaDev5
Copy link
Author

image

@na2axl
Copy link
Member

na2axl commented Jan 4, 2023

Just reproduced your entire pipeline, but I'm not having this issue, even deactivated SourcePass clear but everything is working. Is this actually affecting the motion blur effect? Also did the velocity texture in renderdoc start with the output of the old frame?

Also, if you are having this issue in the editor, I've been through it a bit, It seems to be due to the fact the viewport got initialized with the size defined in Window settings and then resized to the Editor's viewport size. A quick trick is just to resize the viewport again, even a little, and the velocity map shows correct values.

But for in-game windows it should not happen.

@PlasmaDev5
Copy link
Author

Looks like it was the issue with the editor resizing :D it was effecting the motion blur but now i have resized it looks to be working fine

@PlasmaDev5
Copy link
Author

Would this also effect the upscale pass because it errors something about texture size == 0

@na2axl
Copy link
Member

na2axl commented Jan 4, 2023

Yes it can be the cause, but only for the very first frame I think. But the upscale pass is not meant to be used by the editor. And I've done nothing to help in that 😅

This is a game-only feature, since even the scaling ratio (calculated from the selected preset) will be precomputed and hence not usable on sizeable windows...

@PlasmaDev5
Copy link
Author

Would be very useful for the editor as it would allow developers on weaker machines to get that little extra performance. I feel it makes sense to have the editor viewport match the game as close as possible
Ill leave this open until the editor stuff for motion blur is resolved

@PlasmaDev5
Copy link
Author

Also looks to also effect in game with the same issue for motion blur although maybe a little stronger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants