kode80SSR
kode80SSR copied to clipboard
Clip to Screen space
Hello! I had some doubt about your conversion from clip space to screen space in the code present in the shader file: kode80SSR/Assets/Resources/Shaders/SSR.shader. From line 136 - 146:
// Project into homogeneous clip space
float4 H0 = mul( _CameraProjectionMatrix, float4( rayOrigin, 1.0));
float4 H1 = mul( _CameraProjectionMatrix, float4( rayEnd, 1.0));
float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;
// The interpolated homogeneous version of the camera-space points
float3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;
// Screen-space endpoints
float2 P0 = H0.xy * k0, P1 = H1.xy * k1;
The final result that has been commented as screen space end points. Isn't that Normalized Device Coordinates or NDC ?