Merge branch 'master' into 1.5

This commit is contained in:
Wojtek Figat
2022-11-22 19:58:53 +01:00
40 changed files with 400 additions and 206 deletions

View File

@@ -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)
{