File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Packages/com.unity.render-pipelines.universal/Shaders/XR Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,16 @@ Shader "Hidden/Universal Render Pipeline/XR/XRMotionVector"
6262 UNITY_SETUP_INSTANCE_ID (input);
6363 UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO (output);
6464
65- output.position = GetFullScreenTriangleVertexPosition (input.vertexID);
66-
67- float depth = 1 - UNITY_NEAR_CLIP_VALUE ;
68- output.position.z = depth;
65+ output.position = GetFullScreenTriangleVertexPosition (input.vertexID, 1 - UNITY_NEAR_CLIP_VALUE );
6966
7067 // Reconstruct world position
71- float3 posWS = ComputeWorldSpacePosition (output.position.xy, depth, UNITY_MATRIX_I_VP);
68+ // We can use the clip space as is because contrary to the convention mentioned in Common.hlsl (RP Core),
69+ // this clip space is already Y-up
70+ float3 posWS = ComputeWorldSpacePosition (output.position, UNITY_MATRIX_I_VP);
7271
7372 // Multiply with current and previous non-jittered view projection
74- output.posCS = mul (_NonJitteredViewProjMatrix, float4 (posWS.xyz , 1.0 ));
75- output.prevPosCS = mul (_PrevViewProjMatrix, float4 (posWS.xyz , 1.0 ));
73+ output.posCS = mul (_NonJitteredViewProjMatrix, float4 (posWS, 1.0 ));
74+ output.prevPosCS = mul (_PrevViewProjMatrix, float4 (posWS, 1.0 ));
7675
7776 return output;
7877 }
You can’t perform that action at this time.
0 commit comments