Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified decal shader to extract some helper functions to DepthHeader…
….fxh Signed-off-by: Martin Evans <martindevans@gmail.com>
- Loading branch information
1 parent
03b71f9
commit 1eea8cf
Showing
4 changed files
with
17 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
float CalculateDepth(float4 viewPosition, float farClip) { | ||
return -viewPosition.z / farClip; | ||
} | ||
|
||
void ZTest(float zBufferDepth, float pixelDepth) { | ||
clip(zBufferDepth - pixelDepth); | ||
} | ||
|
||
float3 ReconstructWorldPosition(float3 viewRay, float depth, float4x4 InverseView) { | ||
float3 viewPosition = viewRay * depth; | ||
|
||
//Calculate world position of this pixel | ||
return mul(float4(viewPosition, 1), InverseView).xyz; | ||
} |
Binary file not shown.
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