forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ue5.1_fixes' of https://github.com/alonfaraj/AirSim
- Loading branch information
Showing
22 changed files
with
3,887 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
float zOverW = depth; | ||
// H is the viewport position at this pixel in the range -1 to 1. | ||
float4 H = float4(texCoord.x * 2 - 1, (1 - texCoord.y) * 2 - 1, zOverW, 1); | ||
float4 worldPos = float4(worldPosition, 1.0); | ||
|
||
// Current viewport position | ||
float4 currentPos = H; | ||
// Use the world position, and transform by the previous view-projection matrix. | ||
float4 previousPos = mul(worldPos, View.PrevViewProj); | ||
// Convert to nonhomogeneous points [-1,1] by dividing by w. | ||
previousPos /= previousPos.w; | ||
// Use this frame's position and last frame's to compute the pixel velocity. | ||
float2 velocity = (currentPos - previousPos) / 2.0f; | ||
|
||
float2 flow = float2(velocity.x, velocity.y); | ||
|
||
return flow; |
Oops, something went wrong.