Skip to content

Commit 05bbb5e

Browse files
GLTF Viewer: fixed view direction when applying SSR
1 parent 21f94a6 commit 05bbb5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Samples/GLTFViewer/assets/shaders/ApplyPostEffects.psh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ float4 main(in FullScreenTriangleVSOutput VSOut) : SV_Target
3939
SurfaceReflectanceInfo SrfInfo = GetSurfaceReflectanceMR(BaseColor.rgb, Metallic, Roughness);
4040

4141
float4 WorldPos = mul(float4(VSOut.f2NormalizedXY, DepthToNormalizedDeviceZ(0.5), 1.0), g_Frame.Camera.mViewProjInv);
42-
float3 ViewDir = normalize(WorldPos.xyz / WorldPos.w - g_Frame.Camera.f4Position.xyz);
42+
float3 ViewDir = normalize(g_Frame.Camera.f4Position.xyz - WorldPos.xyz / WorldPos.w);
4343

4444
IBLSamplingInfo IBLInfo = GetIBLSamplingInfo(SrfInfo,
4545
g_tex2DPreintegratedGGX,

0 commit comments

Comments
 (0)