-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Flat and VR code with helper functions. NG_mul has been added to replace mul when accessing FrameBuffer content. Additionally code from ShadowPS.hlsl was moved to Framebuffer.hlsl.
- Loading branch information
Showing
6 changed files
with
115 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
float2 GetSSMotionVector(float4 wsPosition, float4 previousWSPosition) | ||
float2 GetSSMotionVector(float4 wsPosition, float4 previousWSPosition, uint eyeOffset = 0) | ||
{ | ||
float4 screenPosition = mul(CameraViewProjUnjittered, wsPosition); | ||
float4 screenPosition = NG_mul(CameraViewProjUnjittered, wsPosition, eyeOffset); | ||
float4 previousScreenPosition = NG_mul(CameraPreviousViewProjUnjittered, previousWSPosition, eyeOffset); | ||
#if !defined(VR) | ||
screenPosition.xy = screenPosition.xy / screenPosition.ww; | ||
float4 previousScreenPosition = mul(CameraPreviousViewProjUnjittered, previousWSPosition); | ||
previousScreenPosition.xy = previousScreenPosition.xy / previousScreenPosition.ww; | ||
#else | ||
screenPosition.xy = screenPosition.xy / screenPosition.zz; | ||
previousScreenPosition.xy = previousScreenPosition.xy / previousScreenPosition.zz; | ||
#endif // !VR | ||
return float2(-0.5, 0.5) * (screenPosition.xy - previousScreenPosition.xy); | ||
} |
Oops, something went wrong.