Skip to content

Commit bbb1203

Browse files
ludovic-theobaldPaulDemeulenaere
authored andcommitted
[VFX][Fix 1400636] XR & World Space Motion Vector incorrect (#313)
* put vertPosWorld into camera relative WS * fix warning + changelog
1 parent 0374b79 commit bbb1203

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3636
- In `Output Particle` blocks, shader graph exposed properties order is consistent with shader graph blackboard
3737
- Picking and Selection passes [Case 1382788](https://issuetracker.unity3d.com/product/unity/issues/guid/1382788/), [Case 1402283](https://issuetracker.unity3d.com/product/unity/issues/guid/1402283/)
3838
- Reduce GC.Allocs in the SceneViewGUICallback. [Case 1305929](https://issuetracker.unity3d.com/product/unity/issues/guid/1305929/)
39+
- Fix Motion vectors in XR. [Case 14003636](https://issuetracker.unity3d.com/product/unity/issues/guid/14003636/)
3940

4041
## [14.0.0] - 2021-11-17
4142

com.unity.visualeffectgraph/Shaders/VFXOutputUpdate.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ ${VFXFeedSortingKeys}
219219
for (int itIndexVert = 0; itIndexVert < VFX_FEATURE_MOTION_VECTORS_VERTS; ++itIndexVert)
220220
{
221221
float4 vertPosWorld = float4(TransformPositionVFXToWorld(verts[itIndexVert]), 1.0f);
222+
vertPosWorld.xyz = VFXTransformPositionWorldToCameraRelative(vertPosWorld.xyz);
222223
float4 vertPosA = mul(_XRNonJitteredViewProjMatrix[0], vertPosWorld);
223224
float4 vertPosB = mul(_XRNonJitteredViewProjMatrix[1], vertPosWorld + stereoOffset);
224225
elementToVFXBuffer.Store4(elementToVFXIndex << 2, asuint(float4(vertPosA.xy / vertPosA.w, vertPosB.xy / vertPosB.w)));

0 commit comments

Comments
 (0)