Fix #127590: EEVEE: Wrong background motion vectors #127718
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127718
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pragma37/blender:pull-fix-background-motion-vectors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Compute the background plane position in world space and reproject it to the camera perspective matrices.
Remove outdated comments.
Note: The code uses points instead of directions. I've tested by offsetting the test scene 1000 units in every axis and it doesn't seem to cause troubles.
The code could be updated to use view directions projected into the far plane (since that's what I think the original intent was?), but I don't think the perspective matrix can be skipped.
I've updated the code to avoid the world space translation, but it requires extra matrix multiplications, so I'm not sure it's worth it.
It can be reverted.
I think I may have think that
winmat
waspersmat
.This new iteration of the patch is the correct fix.
We should not transform the background as points as it would interact during translation of the camera (where the background should have no velocity).
@ -53,4 +52,1 @@
{
/* Only transform direction to avoid losing precision. */
vec3 V = transform_direction(camera_curr.viewinv, vV);
/* NOTE: We don't use the drw_view.winmat to avoid adding the TAA jitter to the velocity. */
I don't see why this is outdated? It is an explanation to why we use
camera_curr.winmat
instead ofdrw_view.winmat
.I misread what the comment meant. I've added it back with a small clarification.
@ -46,3 +45,3 @@
/**
* Given a view space view vector \a vV, compute the previous and next motion vectors for
* Given a background view space point \a vP, compute the previous and next motion vectors for
I am not sure this does any difference. In fact, I prefer keeping the transform on the normalized version
vV
. It makes more sense to transformvV
as a direction thanvP
.Also keeps the patch smaller for back-porting.
It skips one normalization, but other than that it's the same. I've reverted the change.
@ -57,3 +53,1 @@
vec2 prev_uv = project_point(camera_prev.winmat, V).xy;
vec2 curr_uv = project_point(camera_curr.winmat, V).xy;
vec2 next_uv = project_point(camera_next.winmat, V).xy;
/** NOTE: Transform as a direction to avoid imprecision if camera is far from origin. */
Nitpick: Reminder that
/**
is only for multiline comments.BTW it is better for precision to use 2 matrix transform instead of
persmat
. I think this is fine as is.I get confused about this all the time as well. I always have to check what each one means.
I wish we had something like
view_mat
,projection_mat
andview_projection_mat
or something along those lines.I think we can make a todo about this mass renaming.
Done! #127806