Merge branch 'master' into 1.5
This commit is contained in:
@@ -18,6 +18,7 @@ float TimeParam;
|
||||
float4 ViewInfo;
|
||||
float4 ScreenSize;
|
||||
float4 TemporalAAJitter;
|
||||
float4x4 InverseViewProjectionMatrix;
|
||||
@1META_CB_END
|
||||
|
||||
// Shader resources
|
||||
@@ -62,6 +63,14 @@ MaterialInput GetMaterialInput(PixelInput input)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Gets world space position at given pixel coordinate with given device depth
|
||||
float3 GetWorldPos(float2 uv, float deviceDepth)
|
||||
{
|
||||
float4 clipPos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), deviceDepth, 1.0);
|
||||
float4 wsPos = mul(clipPos, InverseViewProjectionMatrix);
|
||||
return wsPos.xyz / wsPos.w;
|
||||
}
|
||||
|
||||
// Transforms a vector from tangent space to world space
|
||||
float3 TransformTangentVectorToWorld(MaterialInput input, float3 tangentVector)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user