Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clip to Screen space #16

Open
ManishJu opened this issue Jul 19, 2017 · 0 comments
Open

Clip to Screen space #16

ManishJu opened this issue Jul 19, 2017 · 0 comments

Comments

@ManishJu
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant