Skip to content

Commit

Permalink
EnvMapRenderer: fixed motion vector computation for ortho camera
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Jan 9, 2025
1 parent fb47dac commit 8f93e77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shaders/Common/private/EnvMap.psh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ SampleEnvMapOutput SampleEnvMap(in float4 ClipPos)

float2 MotionVector = float2(0.0, 0.0);
#if COMPUTE_MOTION_VECTORS
float4 PrevClipPos = mul(float4(Direction, 0.0), g_PrevCamera.mViewProj);
float3 PrevWorldPos = g_PrevCamera.f4Position.xyz + Direction;
float4 PrevClipPos = mul(float4(PrevWorldPos, 1.0), g_PrevCamera.mViewProj);
PrevClipPos.xy /= PrevClipPos.w;
MotionVector = GetMotionVector(ClipPos.xy, PrevClipPos.xy, g_Camera.f2Jitter, g_PrevCamera.f2Jitter);
#endif
Expand Down

0 comments on commit 8f93e77

Please sign in to comment.